File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Repopulating form in struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Repopulating form in struts2 " Watch "Repopulating form in struts2 " New topic

Repopulating form in struts2

Sameer Ahmed

Joined: Apr 15, 2011
Posts: 11
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

Joined: Jul 23, 2010
Posts: 8
i suggest you use the Preparable Interface . You can have a glimpse of what it does here
I agree. Here's the link:
subject: Repopulating form in struts2
It's not a secret anymore!