• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Repopulating form in struts2

 
Sameer Ahmed
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone

I am facing one big problem in my web application.

1. I want to RE- populate a JSP form which consists of textfields and drop downlist(select tag).
I am able to populate (on page load) it correctly from DB but the problem is when a user selects an option from select menu, it goes to the action class then dao and performs some processing and then gets back to the original JSp and there the form fields(which were populated) are no longer populated.
How can I make the java bean to persist ?
What I am doing right now is that I call the populate method again and again but that does not sound to be a good thing.
I am using ModelDriven. I read somewhere that ScopedModelDriven can be used but I am not able to find any good example or tutorial on that.

please let me know a better solution
 
Sanal Samuel
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i suggest you use the Preparable Interface . You can have a glimpse of what it does here http://struts.apache.org/2.0.11/docs/prepare-interceptor.html.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic