aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
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?
Trouble with model for calculating and adding table values dependent on multiple rows
Struts and how to use MVC for it