Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.
(Answer) (Category) Java Apache Project : (Category) Apache JServ 1.0 : (Category) General :
What methods/packages exist to enhance the presentation of my servlet site?
Simple servlets will contain something like:
  PrintWriter out = req.getWriter();
  out.println("<HTML>");
  ...
  out.println("</HTML>");

For larger servlets, where presentation is important, this is not ideal for many reasons. For example, if a web designer was tasked with designing the look and feel of the site, they may not be comfortable editing and compiling Java servlet programs. There are two mainstream solutions to this problem:

Page Compilation is when servlets are compiled and run on-the-fly by the web server from Java code embedded in the web page. JSP is described at http://java.sun.com/products/jsp/index.html. GnuJSP is a free implementation of the JSP standard. You might want to check it out at http://www.nmg.nl/~vinny/gnujsp/. Another implementation called GSP, can be found at http://www.bitmechanic.com/projects/gsp/.

Template System, is when you base your page layout in an HTML template. A few Java Apache members have created a template package, which has not yet been packaged and released. It can be checked out using anonymous CVS from the same repository as Apache JServ as the module 'jserv_utils'. See the CVS instructions on the Java Apache Project web site for more information on this.

Recently, a totally new approach based on XML/XSL was made available by the Cocoon Project. This project aims to separate page content, style and logic on different files allowing parallel development as well as reuse for medium to complex web sites. If managing your site has become a nightmare, you should check it out and see if it feets your needs.

There is also the Element Construction Set project which allows one to replace out.println() statements with actual Java objects. More information can be found at the ECS website.

[Append to This Answer]
Previous: (Answer) When will next release of Apache JServ be ready?
Next: (Answer) How do I create different work areas for several developers?
This document is: http://java.apache.org/faq/?file=195
[Search] [Appearance] [Show Expert Edit Commands]
This is a Faq-O-Matic 2.709.
Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.