• 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

In struts project , In one JSP page ,do new,edit,delete

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI ALL,
i have a JSP Page AddSubscriber.jsp, when i select subscriber name from
search.jsp then all details shoul be display in AddSubscriber.jsp.

and using this jsp page how can i add data in database ?
how can i do in same jsp page ?
i have a already all action classes like (add,edit,delete).
i have only question about jsp code.

please give some advise.

Thanks in anticipation.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since Struts uses the MVC (Model/View/Controller) model, it encourages separation of these three elements of an application. Since the JSP is part of the View, it really shouldn't be performing functions that belong to the realm of the Model. Since database access is considered part of the Model, Struts provides no utilities for accessing a database in a JSP and discourages you from doing so.

When writing a Struts application, you will generally write the JSP so that it only deals with how to present and collect the data. When the user submits the form, struts calls the appropriate action class. Your action class should then delegate the task of accessing the database to some Model objects. You may want to check out some of the patterns and frameworks available for database access and object/relational mapping such as JDBC using the Data Access Object Pattern, JDO (Java Data Objects), Hibernate, etc.
 
A magnificient life is loaded with tough challenges. En garde tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic