• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which one to choose

 
rudhras
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Can any one say under what circumstances we should use Jsp or Servlets as appropriate ...
 
Frank Carver
Sheriff
Posts: 6920
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"rudhras",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . 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.
Thanks.
 
Sandeep Jain
Ranch Hand
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Frank Carver
Sheriff
Posts: 6920
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic