• 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

about jsp... and about not using one

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
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
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 ]
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic