• 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

Model 1 or Model 2 architecture?

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please advise if what I am doing would be considered good practice and fall under the MVC pattern?

I have a JSP with a Form where values are submitted by a user. The JSP is submitted to a Servlet where the Servlet decides what to do with the info. The Servlet calls Java classes to do stuff depending on what was entered in the JSP Form. For example if the user didnt enter all the values or there were validation issues the Servlet would call a Validator JavaBean class and then redirect the user to a JSP with the validation errors. If the user enters valid data the Servlet would call another Java class with SQL insert statements to insert the info into the database.

I dont have Struts in my Tomcat 4.1.3 containre so I am using Scriptlets with JavaBeans on the JSP to show information.
[ November 01, 2007: Message edited by: Joseph Smithern ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds right to me. Since you are using JSP 1.2 (Tomcat 4), you can use only JSTL 1.0, so it may be necessary to use some scriptlets on the page. Just be careful not to let the scriplets get out of control and start doing work that's best done in the controllers.

I'd advise a move to JSP 2.0 (Tomcat 5+) as soon as you are able and to ditch all scriplets on the pages in favor of JSTL 1.1 and JSP 2.0 EL.
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic