Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Should I be using servlets

 
cormac o donnell
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have recently "inherited" in my new job a web based application tied to a MySQL database which has been coded in jsp, servlets and javascript.

I am currently in the middle of an overhaul of the entire system, and i have found that the system sometimes uses servlets and sometimes does not.

One area of the system is basically a web based results and fixtures aplication, users can log in and add in fixtures for football matches.

The system uses forms to enter new fixtures in the D/B and uses only jsp code to achieve this. In other areas of the system it uses servlets to do basically the exact same thing.....?

I am overhauling the system, which has many other applications like the fixtures/results which involve d/b accessing, and in the future i am intending to give the system users different levels of access, such as able to view and not edit.

Could someone please advise me as to how they would code this project, use servlets or jsp code? or advise a new way


Regards

Cormac
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To get the best of both worlds most of us use a combination of the two (but not the way the app you've inherited does). Read up on the Model View Controller (MVC) design pattern. When implemented properly it allows for a clean separation between markup (view), database code (model) and the flow control (guess) in your app. This is particularly advantageous if you plan to use designers to alter the look and feel of your app because it keeps all the control flow and database code out of their hands.

There are several frameworks out there like Struts, Java Server Faces, and Tapestry which already have a lot of the groundwork laid out for you.

To get a REAL basic idea of how it works, go to http://simple.souther.us
and download the SimpleMVC application. It's a war file so you should be able to drop it into the webapps directory of a running Tomcat instance and use it.
Your mileage will vary if you're using another container.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!