File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
    It's not a secret anymore!