• 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 is better java servlet or jsp ??

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can anyone tell me what is the difference between
java servlet & jsp.
and which is the best of them?
thank'z in advance
bye.

------------------
Sagar Surana
optimist
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A JSP is just another way of constructing a servlet.
Choosing one or the other depends on what you are trying to create. If the HTML pages you want to create are heavy on the HTML and don't need much Java code, JSP is worth looking at.
If you creating functions that can be expressed as custom tags, JSP is what you want.
If your application involves a lot of decision making and branching, a servlet is what you need. You can also combine a decision making servlet with JSP pages that handle various specific types of output.
I suggest getting comfortable with writing servlets first so you can understand basic ideas and limitations of servlets. Servlets are easier to debug.
Bill

------------------
author of:
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
aren't servlets dying down with the advent of JSP. Doesn't a jsp engine comiple a JSP into a servlet after it is accessed the first time? If the jsp requires lot of branching and complex programming stuff, wouldn't creating a bean (multi-tier) and still using JSP not a solution?
Need clarification!!

Thanks
Zaeem
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
servlets are used for small projects.
for medium to large projects use jsp.
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IMHO, Servlets should be only used as dispatch/processing modules (ie. posting to or some other specialized task).
JSPs should be used for presentation.
This argument is made because clients I've worked with don't necessarily agree with my web-designers and they work out the kinks. I don't want a web-designer mucking around in my servlet code, it's harder to totally ruin a JSP page. If they do, it's their fault haha .
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
aren't servlets dying down with the advent of JSP.
NO! (Many people consider JSP to be Ugly Tech)
Doesn't a jsp engine comiple a JSP into a servlet after it is accessed the first time?
To be precise - WHEN it is accessed for the first time.
If the jsp requires lot of branching and complex programming stuff, wouldn't creating a bean (multi-tier)and still using JSP not a solution?
There is a near infinity of possible architectures, some people swear by a single servlet which takes all requests, decides what to do, and dispatches the request to the appropriate JSP for output.
Like everything else in computing - consider the task at hand, don't just blindly apply the current buzzword technology.
Bill
(Who personally writes pretty big servlets)
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks Bill
Zaeem
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic