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

Reply via email to