• 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

what should i use servlet or jsp

 
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear sir

Suppose a project has been asigned to me. How will i know that whether i have to used servlet or jsp.

with regard

Arun kumar maalik
 
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
You don't choose one or the other. You use both to their best advantages.

Perhaps, this article on web application structure might be helpful.
[ August 24, 2006: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And quite possibly you should use neither.
If you need to ask this question that's the most likely answer and you should tell them you don't have the skills to complete the project.
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello arun, to begin with, i am an amateur, and have just started a project. i have tried my best to answer.

MVC pattern would be the answer to your question. leave all the business logic to model(POJC, EJB), presentation logic to jsp, and control(servlet) as a mediator between view and model. Though you can call model from view, it' a bad practise.
Think of jsp as a dymnamic HTML page that clients see(ofcourse, that what they are developed for). with dynamism comes the scripting. don't use secripting in jsp, use ELs, tags etc.,instead.

so, to epitomize, use all the three (jsp, servlet, and POJC or EJB).

thank you and see if it's enough, else reply.
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use Servlets to handle the incoming request, inspect the request, and figure out what the heck the client wants you to do.

Use a JSP to format a nice HTML or WML page to be sent back to the user.

If it's not control logic, which sho uld be in the Servlet, or display logic that should be in the JSP, use a JavaBean or POJO or even an EJB.

You can do it, dude!

Here are some good multimedia presentations on creating Servlets and JSPs using WSAD and IRAD. Even if you're not using those tools, the code still applies.

http://www.technicalfacilitation.com/get.php?link=wsad

Good luck!
[ August 27, 2006: Message edited by: Bear Bibeault ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic