• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Reference to ActionForm in jsp

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

A very basic question.
If I have to display to the user the data entered by him when he clicks the back button then how do I reference the form variable in the jsp.

I need to refer the form variable because i want to display the text boxes etc with values entered by the user.

Regards,
Chetan
 
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One way would be like this -

in struts-config.xml file set the <forward path="action path of nextform">. Here I am assuming that you are extending your class with ActionForm. so before the next page is displayed, the validate() method will be called , where you can set form values from HttpServletRequest parameter.

other way can be -

using request.getAttribute() method in second jsp form in struts tag.
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chetan,

I'm trying to respond to your PM but you have your account set not to receive PM's. My preferred method would be to email you to discuss this, but you don't have an email address associated with yout account either. If you would, please send me an email and we'll discuss the issue raised in your PM.

Thanks,
Jason
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic