File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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.