• 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

why i cannot get request object in Action class from jsp

 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i cannot get request object in action class in struts.i set arraylist value in request Object(request.setAttribute()),howerver i connot get request object in DispatchAction class using request.getAttribute(). please tell is there any other way to get ArrayList Object from jsp page to Action class excluding session Object.

 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't pass data from a JSP to an action by using request.setAttribute in the JSP. The reason for this is that the when the JSP is rendered and the resultant HTML sent back to the browser, the request is then out of scope. When the Action is called, you have an entirely new instance of HTTPServletRequest, and the old one is no longer accessible.

If you want to pass data from the JSP to the Action, the best way to do so is by setting form input fields to some value. If you want to pass a value that is not displayed, use a hidden field (html:hidden tag).
 
reply
    Bookmark Topic Watch Topic
  • New Topic