• 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

JSP to Bean to Servlet

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I don't know if I am having a brain freeze this morning or what.
I have a JSP Page with a Form. I have a Form Bean for the data. Then I have a Servlet which uses information from the Bean to put it in a database.
So my question is, when I hit submit, do I need ANOTHER "worker servlet" to put the info into a bean, then forward that on to the DB Servlet? Or should I screw the bean and just call the DB Servlet from the JSP page and use requeset.getParameter() to get all my form data?
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Current J2EE Fashion dictates that you use some implementation of the MVC pattern One of the consequences of this is that you'll have only one controller servlet, and delegate the actual work to helper classes. In your case, you'd have a database helper that stores the bean state in the database. There are many ways to do MVC these days; Struts is popular example. But before you dive into Struts, I would 'just' re-shuffle your servlets into 1 servlet and 2 helper (if I were you).
Hope this helps.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic