net.sf.scmwebgui
Class TemplateServlet

java.lang.Object
  extended by VelocityServlet
      extended by net.sf.scmwebgui.TemplateServlet

public class TemplateServlet
extends VelocityServlet

TemplateServlet uses jakarta's Velocity project to return the GUI for the user. The template to be rendered is searched by TemplateFinder, given the template name specified by the user in CtxURI.getTemplate().

Templates will have the following context attributes for painting:

TODO: Implement edition of presentation templates with RichText component.

Author:
mballesteros

Constructor Summary
TemplateServlet()
           
 
Method Summary
 Template handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Context ctx)
           main routine to handle a request.
 void init(javax.servlet.ServletConfig config)
          Initializes the servlet
protected  java.util.Properties loadConfiguration(javax.servlet.ServletConfig config)
          Called by the VelocityServlet init().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateServlet

public TemplateServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initializes the servlet

Throws:
javax.servlet.ServletException

loadConfiguration

protected java.util.Properties loadConfiguration(javax.servlet.ServletConfig config)
                                          throws java.io.IOException,
                                                 java.io.FileNotFoundException
Called by the VelocityServlet init(). We want to set a set of properties so that templates will be found in the webapp root. This makes this easier to work with as an example, so a new user doesn't have to worry about config issues when first figuring things out

Throws:
java.io.IOException
java.io.FileNotFoundException

handleRequest

public Template handleRequest(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response,
                              Context ctx)
                       throws java.io.IOException

main routine to handle a request. Called by VelocityServlet. In this handler we return the setted template, or the setted error template

Parameters:
ctx - a Velocity Context object to be filled with data. Will be used for rendering this template
Returns:
Template to be used for request
Throws:
java.io.IOException


Copyright null null. All Rights Reserved.