Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need to retrieve values from database on page loads.

 
Prem Bhazee
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic