Thanks Dave,
ok I did that and got it working. Although it's not clear to me why my
first attempt doesn't work.
I read about the built-in ajax features. Not sure if they are
approriate for my needs. Have to go into that more thoroughly, later.
Regards, Mirko
Am 24.06.2009 um 15:44 schrieb Dave Newton:
Mirko wrote:
Hi all,
I'm new to Struts and struggling with Struts2/Javascript.
I have a jsp website with a search form (textfield and submit
button). Submitting the button calls the Struts action
"SearchAction". "SearchAction" gets the property "searchInput" from
the jsp website and does something with it. This works.
But now: I have some (Dojo-)Javascript on my jsp website from which
I want to call the request. The Javascript (instead of the submit
button) sends a HttpRequest to "SearchAction". I assumed that, like
above, "SearchAction" could get the property "searchInput". But
this does not work. "SearchAction is called, but the "searchInput"
property is null. How would I manage that?
I'd assume that the dojo.xhrPost has some means of sending form
data: you need to serialize the form so the action gets the form
parameters.
That said, depending on your actual needs, there's built-in support
for submitting a form via Ajax and updating a div with the action's
response.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org