This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes JSP struts - database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSP struts - database" Watch "JSP struts - database" New topic

JSP struts - database

namrata suri
Ranch Hand

Joined: Oct 22, 2009
Posts: 31

I have written a code in which based on a user's selection, he either inserts data into a db or data is simply displayed from the db.
I had originally written everything in jsps using sql taglibs but was advised to use struts so that the presentation layer was different from the functional. I could implement that for the insert functionality but for the display part, I am having trouble understanding how to achieve it using struts.

So, when the user selects 'display' option, I included a form that autosubmits. So, i made a mapping in struts-config.xml for an action class. Now in the action class, I execute the sql queries and get a result set. How do I pass this to a jsp so that the values are printed.

Amit Vinod Dali
Ranch Hand

Joined: Apr 14, 2010
Posts: 42
  • Simple Struts Example
  • Data Retention in JSPs using Struts
    I agree. Here's the link:
    subject: JSP struts - database
    Similar Threads
    Action Class or Regular Java Class to use?
    Want to display result on the page
    Getting results to the forwarded page
    Where to write Validation
    How can read data from DB