struts2 - How can i access a parameter passed by an action in javascript? -
i'm using struts2 , have code triggers after action performed (via ajax):
dojo.event.topic.subscribe("cambioproyecto", function() { var hola = json_entregables; alert("hola"); } the *json_entregables* variable parameter given via struts2. can access in jsp, no problem. can't in script. problem?
i figured out way gat wanted it's rather unclean. since anonymous function callback function ajax process, captured response defining parameter function. response string actual html of response.
now, access parameter, have include value inside jsp hidden element. this:
<s:hidden id="hidden_json_entregables" value="%{json_entregables}"/></p> then, got through jquery this:
dojo.event.topic.subscribe("cambioproyecto", function(jsp) { var o = $(jsp) var string_entregables = o.find("#hidden_json_entregables").text(); } anyway, don't think it's way wouldn't recommend it. worked me. thank support.
Comments
Post a Comment