Help coderanch get a
new server
by contributing to the fundraiser
  • 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

Servlet Design Question

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks,

I'm working on project and have a design question I was hoping I could get help with. Basically, I have created a small application that about 200 users will be using to input work log information. The main page allows the users to submit information and the information is then displayed back to the user on the same screen so they have the option to see what they've submitted and make updates. They can of course continue to enter new information. (Basically just adding continuously to a table) I'm wondering what the best way is to handle how to store the user input. Right now the validation is all done with JSF and then I forward the response to a servlet which stores all the input within a vector. The vector is stored as a session object. When the user clicks save, the vector is saved to the database. This doesn't seem like the most elegant way to handle the situation and I'm wondering if I should use a bean or perhaps even an EJB? I'm new to J2EE and there has been a lot of information to take in, especially in such a short amount of time so any advice/input is appreciated. THANKS!!!

Andreas
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is not an easy question !

To make your life easier if you can i propose you to look at existing framework.

First for the MVC :there are lots of ! i've used some, based on jsp (struts,webwork) but there are probably other for JSF

Then an ioc container (a bean factory ): Spring is the most used but other can be used
Last an pesistence framework: You also have the choice : hibernate , jdo ,.......... or better if you can already used the new specification jpa. I will not advice you to use ejb version 2 for you persistence mechanism.

The principe is the same and based on model . You create some pojo Your MVC framework help you to manipulate this on the web and your persistence framework will help you to save and read from the db.And your IOC will be used to decouple the two part !


your question is so large and my answer is so small
But i hope it helps.

[ July 11, 2006: Message edited by: Benjamin Leonard ]
[ July 11, 2006: Message edited by: Benjamin Leonard ]
 
Andreas Sandberg
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you! I will look into using hibernate and spring and this seems to be a fairly popular choice at the moment. Any opinons regarding struts? So much to learn, so litle time Thanks again.

Andreas
 
Sheriff
Posts: 67750
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
Personally I think you should avoid using any framework until you have a thorough understanding of JSP, servlets and proper web application structure. Then you can decide if, and if so, which framework might be appropriate.
 
Andreas Sandberg
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear,

When you mention web app structure do you know of any good tutorials or reading material? I've gotten jsp's and servlets down pretty good and do have my application working. From a design point of view though I'm not very happy with it as I feel it's a bit sloppy, even though I've tried to implement things according to the MVC model 2 design pattern. I have a main servlet acting as a request dispatcher but the way I'm making my calls to the database is very ugly. Thanks!!!

Andreas
 
Bear Bibeault
Sheriff
Posts: 67750
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
I wrote this article recently for the JavaRanch Journal.
 
author
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear Bibeault

I wrote this article recently for the JavaRanch Journal.



It is an excellent article on the MVC. Also would be nice to cover session synchronization token pattern in addition to the PRG pattern.
 
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic