• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Initial Page

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys I am just starting off with Struts 2. I have been able to make some simple webpages, where I pass a word in the URL have the action access a database and then display information regarding that word into another page.
What I do not seem to be able to accomplish is accessing the database on the first page I visit. Since so far everything I have done is JSP-> Action ->MySQL->Action->JSP. How could I go to my main page(index.jsp) and have database values available?

One though I was having is to have my first page (index.jsp) automatically redirect to an action which will then take me to the database, then back to the action and lastly back to index.jsp. But this seems akward especially since index.jsp will have to keep track that it is the second visit in order for it to not fall into an infite loop. Thanks
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can either set the welcome page to an action (some servers require additional settings to make this work) or redirect from a welcome page to an action.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic