The moose likes Struts and the fly likes problem with request parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem with request parameter" Watch "problem with request parameter" New topic

problem with request parameter

Rehana Shaik
Ranch Hand

Joined: Jan 03, 2003
Posts: 33
Hi, I am new to struts. I am having one link on normal jsp page which is having one parameter in querystring .the invoked has to invoke differnt pages depends on the parameter that is included in the url. but i am unable to get the value of the parameter in the action class by request.getParameter(string).My link is like this /update.jsp?from=update .I want from value in updateAction class.
Thanks in advance
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6529

Unless you have mapped all *.jsp URLs to the Struts ActionServlet in your web.xml, your link will not go through the Struts framework.
See example of how you would map a URL pattern to the ActionServlet at
You need your link to go through an Action, e.g. via / in which case I wouldn't think you should need a request parameter. At any rate, you can still put a parameter, e.g. / if you really want to (doesn't that seem redundant to you though?). The Action mapped to would need to be associated with an ActionForm that has the methods getFrom()/setFrom().
In the Action, you normally don't need to extract parameters from the request since those values have already been transferred into the ActionForm (and converted to the appropriate type) for you by Struts.
Go through the tutorial I cited above to get a good understanding of the basics.

Junilu - [How to Ask Questions] [How to Answer Questions]
Rehana Shaik
Ranch Hand

Joined: Jan 03, 2003
Posts: 33
Thank you
I agree. Here's the link:
subject: problem with request parameter
It's not a secret anymore!