• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with request parameter

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 http://www.reumann.net/do/struts/lesson1/step7)
You need your link to go through an Action, e.g. via /update.do in which case I wouldn't think you should need a request parameter. At any rate, you can still put a parameter, e.g. /update.do?from=update if you really want to (doesn't that seem redundant to you though?). The Action mapped to update.do 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.
 
Rehana Shaik
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic