It's not a secret anymore!
The moose likes Servlets and the fly likes Which one to choose Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Which one to choose" Watch "Which one to choose" New topic

Which one to choose


Joined: Feb 26, 2001
Posts: 10
Can any one say under what circumstances we should use Jsp or Servlets as appropriate ...
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please choose a new name which meets the requirements.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Sandeep Jain
Ranch Hand

Joined: Oct 25, 2000
Posts: 124
Hello there ,
Dynamic generation of html in servlets is a very tedious job ,So we use jsp basically for that .Besides this jsp's are much faster than the servlets .Only for the first time they take some time but once it is over , from next request its very fast.

Sandeep Jain

Try and Try Till u succeed<br /> <br />Sandeep Jain
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
This is a peculiar bit still surprisingly popular misconception. A JSP is compiled to a servlet, so it is a servlet. There is no way a JSP can be faster than a servlet doing the same job.
Also remember that page compilation (from JSP for example) is not the only way to get rid of printing a lot of HTML from a servlet. For many uses, a template processing system (such as WebMacro, Velocity or FreeMarker) is a better and more flexible solution. Also many systems are now generating XML and processing it through a stylesheet for transformation into HTML.
I agree. Here's the link:
subject: Which one to choose
It's not a secret anymore!