wood burning stoves*
The moose likes Struts and the fly likes Need to retrieve values from database on page loads. 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 "Need to retrieve values from database on page loads." Watch "Need to retrieve values from database on page loads." New topic
Author

Need to retrieve values from database on page loads.

Prem Bhazee
Ranch Hand

Joined: Feb 18, 2006
Posts: 34
Hi Ranchers,

I am fairly new to struts. I need to retrieve values from a database when my home page is loaded.

Can I call my application url with databasevalues.do so this action class is called.


or I am not sure should I use Form submit in a JSP to pass action to the
/databasevalues and show the values from db to the same JSP like this

firstpage.jsp
<html:form action="/databasevalues " focus="name">
</html>



Thanks in advance
Bhazee
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
It's all a question of when you need the values from the database. If you need them before the JSP is displayed, then you should call databasevalues.do as the URL. If you don't need them until after the form is submitted, then just make databasevalues the action for your form.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need to retrieve values from database on page loads.
 
Similar Threads
Adding 1 row to specific section of a struts table using iterate tag
Redisplaying a page after validation due to validation errors?
Cannot find Bean under name..
Question regarding Struts Validator
ActionMapping - findForward() problem