dlr         00/10/14 20:49:35

  Modified:    src/java/org/apache/velocity/servlet VelocityServlet.java
  Log:
  Minor code cleanup and JavaDoc addition.
  
  Revision  Changes    Path
  1.4       +17 -12    
jakarta-velocity/src/java/org/apache/velocity/servlet/VelocityServlet.java
  
  Index: VelocityServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/servlet/VelocityServlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- VelocityServlet.java      2000/10/09 17:23:42     1.3
  +++ VelocityServlet.java      2000/10/15 03:49:35     1.4
  @@ -77,11 +77,19 @@
    * and add your data to the context. Then call getTemplate("mytemplate.wm")
    * 
    * @author Dave Bryson
  - * $Revision: 1.3 $
  + * $Revision: 1.4 $
    */
   public abstract class VelocityServlet extends HttpServlet
   {
  +    /**
  +     * The encoding to use when generating outputing.
  +     */
       private String encoding;
  +
  +    /**
  +     * Whether to use the <code>FasterWriter</code> hack for faster generation 
  +     * of ASCII output.
  +     */
       private boolean asciiHack;
   
       /** 
  @@ -89,24 +97,21 @@
        * @param ServletConfig
        */
       public void init( ServletConfig config )
  -     throws ServletException
  +        throws ServletException
       {
           super.init( config );
           
  -        String file = config.getInitParameter("properties");
  +        String propsFile = config.getInitParameter("properties");
           try
           {
  -            Runtime.init(file);
  -            
  -            encoding = Runtime.getString(
  -                Runtime.TEMPLATE_ENCODING);
  +            Runtime.init(propsFile);
               
  -            asciiHack = Runtime.getBoolean(
  -                Runtime.TEMPLATE_ASCIIHACK);
  +            encoding = Runtime.getString(Runtime.TEMPLATE_ENCODING);
  +            asciiHack = Runtime.getBoolean(Runtime.TEMPLATE_ASCIIHACK);
           }
  -        catch( Exception e1 )
  +        catch( Exception e )
           {
  -            throw new ServletException( "Error configuring the loader: " + e1);
  +            throw new ServletException("Error configuring the loader: " + e);
           }
       }
       
  @@ -139,7 +144,7 @@
           
           if ( template == null )
           {
  -            error( response, "Cannot find template!");
  +            error(response, "Cannot find template!");
               return;
           }
   
  
  
  

Reply via email to