This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes retrieve values from database at the time of form loading using struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "retrieve values from database at the time of form loading using struts" Watch "retrieve values from database at the time of form loading using struts" New topic
Author

retrieve values from database at the time of form loading using struts

swee shah
Greenhorn

Joined: May 15, 2009
Posts: 3
In my module (skill maintenance is module name and skill is table name) I have to take reference of another module, that is skill category (and table name is skill category). At the time of skill creation, (that is first form of my module) I need data from skill category table. So at the time of form loading my combo should be filled with data of another table.


In model I have written code to fetch data from skill category table and set it into VO but I am afraid this model will be called only when we press submit button of the create skill form. So no values will be set in VO and so it is showing null pointer exception.

Can any one tell me how to resolve this problem?

Ranveer K Kumar
Ranch Hand

Joined: Sep 13, 2009
Posts: 64
Before forwarding to the create skill page load call the action which you need to load at create skill page.

for example:

If you are calling this page(create skill page) from pressing button or link, then you can call the action on that link/button. And the action will create skillSetList and forward to create skill page.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: retrieve values from database at the time of form loading using struts
 
Similar Threads
Trouble with model for calculating and adding table values dependent on multiple rows
EJB Design With Value Objects
DTO/VO or a Universal Map
How to determine when a form field is submitted if it's changed from the original value?
Struts and how to use MVC for it