• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Design consideration

 
Majid Khan
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating an appln whereby a co is getting lots of small job like dataentry etc.
Thses tasks are assigned to different employees.
1. So employees should be able to fill in periodic task sheets for the projects they have done & the time spent.
2. Co wants to know how much time time has been spent by all the employees on a particular project.
I am considering a design for this soln. Since this is going to be on intranet aplln.
My choice would be to use jsp as front end.
The design appears simple
one form for the employee to fill in data
second for the company to genrate reports.
Can anyone suggest a better architecture. or is jsp ok?
how else to decide?
Any expert comments.
thanks,
Majid
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP sounds like a good approach to me. Since it's on an intranet, you could even use applets outside the sandbox if you need to. You may want to add some servlets to take care of the data and responses.
 
Majid Khan
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Michael.
Can you elaborate more on the need for servlets.
As I am not getting a clear picture of the whole scenario.
I was thinking of 2 jsp pages one for time sheet input & another for results. is it ok?
I need more details on how to convert design into code.
As you can what is to be done is clear, how it is to be done is the question.
Can you elaborate more do write in.
Any advise on this is welcome.
regards
Majid
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general, a JSP should only be used for displaying somethign to the user. Servlets should be used for calculation code that does not display anything to the user.
The reason for this is two-fold: a). They are designed that way (do it because we said so! ) and b). You have more direct control over things with a servlet.
A little elaboration on b). If you want to redirect the user to another page, you cannot write anything to the output stream before redirecting, else you will get a runtime error. JSPs, however, are designed to write things to the output stream. This doesn't mean that you can't use JSPs to do the job, it just means that you have to be very careful with how you code them, else you will get this error.
Remember that when it comes to Web Apps, JSPs are compiled into servlets behind the scenes. This means that Servlets are required for a web app; JSPs are not.
(Also, the Web Server has to compile a JSP the first time you use it. By writing non-user-output code into servlets, you save just that tiny bit of overhead...)
So the pattern is something like this:
User Form (JSP) -> Process Form (Servlet; data processing happens here) -> Results page (JSP, redirected to from the Servlet)

Hope this helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic