• 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
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Repopulating form in struts2

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I once met a man from Nantucket. He had a tiny ad
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic