[Dojo-interest] Dojo + Struts 2
Yogesh Mujumdar
yogesh.mujumdar at gmail.com
Fri Jan 5 23:59:16 MST 2007
If i have got it right, this iswhat you want to do.
A JSP on the server has dojo.io.bind to call some action class of Struts
which returns some variables. These vars you want to be able to pass to some
function which will get invoked when the compiled jsp comes to the client as
html.
If thats what you want, then i suggest not to use dojo.io.bind in the jsp
coz the jsp and the action class are both on the same server right? Then why
to use the bind function to get data from the Struts action class. Just make
a call in the JSP to get the vars and put it in the callback function args.
Something like this :
<script>
nction someCallback(foovar) {
doSomeDojoOrAnything();
}
</script>
<%
String var1 = actionObject.getFoo();
%>
<input type='button' onClick=' someCallback("<%= var1 %> ");' >
On 1/5/07, Purnima Venkatram <purnima.venkatram at gmail.com> wrote:
>
> Has anyone used struts 2 and dojo ?
> I had posted a doubt some days back and dint get a reply from anyone . And
> i am stuck at that point. I wanted to return variables from my Action class
> to the callback function in jsp. I am invoking the Action class with
> dojo.io.bind api. I have defined getter methods for those variables in my
> Action class. how do I access those varibles in the callback function ? I
> need to set some elements of the form based on the values returned by the
> Action class.
>
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
>
--
regards/Yogesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20070105/59362c8a/attachment.html
More information about the Dojo-interest
mailing list