This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Struts in jsp for db add and update

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
i m new to struts, how should i use struts for my db access list one of its field in a combo box , and update if requiered.

also add a new row to the db table...

howz it possible any clear suggestion...

plz
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're looking for a quick and easy way of accessing the database from the view layer as is possible in PHP, ASP, and even in JSP through jstl, you won't find it in Struts. The Struts architecture is specifically designned for separation of layers between the view (The JSP), the controller (The Action Form) and the model (Classes you write to acces the database, and objects you write to represent the business model).

The struts way to do it is:
  • User calls an action
  • Action calls on classes in the model that access the database and return information
  • Action uses this information to populate an ActionForm
  • The Jsp reads the information in the ActionForm to display the data


  • My advice is to look at the JSPs, Action Classes, and ActionForms in the struts-example.war that comes with the download, and get a feel for how they work together.
     
    A day job? In an office? My worst nightmare! Comfort me tiny ad!
    Java file APIs (DOC, XLS, PDF, and many more)
    https://products.aspose.com/total/java
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!