• Post Reply Bookmark Topic Watch Topic
  • New Topic

about jsp... and about not using one

 
ronald ali mangaliag
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
am relatively new to jsp and servlets but not that really new to java... i just downloaded tomcat for my next project and was wondering about some things...
first, should i use jsp or servlet? what are my guidelines in using one or the other?
second, can i use jsp as a template tool??? or are there available templating tools for jsp??? (i am more exposed to python-cheetah and php-smarty
last, they say that php-like languages/tools/frameworks (like jsp) are very hard to manage and maintain ... is this a myth???
am quite a newbie to jsp/servlet... please dont hurt me that much...
thanks...
ali
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys! A newbie! Let's gang up on him!
Seriouly, I thnk you'll find this forum a far cry from somewhere where that would happen.
A few quick answers to your questions:
1) I generally use both. The request comes into a servlet which performs any necessary processing (such as DB access). Then the request is forwarded to a JSP to handle the display portion of things.
You generally do not want to use JSP at all when you are not returning text (e.g. serving up an image, PDF or other binary data). For that, I rely on pure servlets.
2) JSP is a templating technology. Sets of custom tags are available (or can be written by you) to extend the capabilities.
3) I find the exact opposite to be true. A well-architected web application using Servlets/JSP is a joy to maintain and extend. Like any other technology, something badly designed will be a hassle.
[ February 06, 2004: Message edited by: Bear Bibeault ]
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to be a little bit wary of directly comparing PHP and JSP/servlets. While PHP and JSP are fairly similar in structure and capabilities, the addition of servlets and the web application concept to the Java equivalent makes for much more choice and flexibility in design.
As Bear said, a well-architected JSP/servlet web application can be much more pleasant to refactor and maintain than the PHP approach of encapsulating all the application in one or more cooperating scripts.
If you prefer a run-time templating approach rather than JSP's precompilation model, there are plenty of template systems available. Well-known names include WebMacro, Velocity, FreeMarker, etc.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!