<s:form method="post" action="MyAction"> </s:form>
In the commons classes at http://kenai.com/projects/commons, there is a class ServletUtils with the following code to extract parameters and place them into a Collection from a servlet request (which can be obtained via ServletActionContext.getRequest()):
public static Collection<String> getParameters(ServletRequest servletRequest)
{
Collection<String> results = new ArrayList<String>();
Enumeration e = servletRequest.getParameterNames();
while(e.hasMoreElements())
{
String parameterName = (String)e.nextElement();
results.add(parameterName);
}
return results;
}
On Oct 12, 2009, at 12:19 PM, Michael Varlik wrote:
Hi,I'm using a Struts2 action to devliver JSON data. This action is calleb by an Ajax HTTP request. Now, I need to send some parameter along with the request. The sending of the parameters works fine but I don't know how to access them from within the struts action. So my question is: what is the proper way to pass POST parameters to a struts action and how do I retrieve them from within the action?Many thanks in advance. Cheers, Michael -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
-- [email protected] Blog: http://ff1959.wordpress.com http://www.directory-server.org Mobile: 404 925 6385
smime.p7s
Description: S/MIME cryptographic signature

