geirm       01/03/15 20:50:57

  Modified:    src/java/org/apache/velocity/servlet VelocityServlet.java
  Log:
  Added the HttpServletRequestWrap around the request in the context.
  
  Revision  Changes    Path
  1.26      +8 -3      
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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- VelocityServlet.java      2001/03/13 03:52:06     1.25
  +++ VelocityServlet.java      2001/03/16 04:50:57     1.26
  @@ -83,6 +83,9 @@
   import org.apache.velocity.context.Context;
   import org.apache.velocity.VelocityContext;
   
  +import org.apache.velocity.app.HttpServletRequestWrap;
  +import org.apache.velocity.app.Velocity;
  +
   import org.apache.velocity.exception.ResourceNotFoundException;
   import org.apache.velocity.exception.ParseErrorException;
   
  @@ -122,7 +125,7 @@
    * @author Dave Bryson
    * @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
  - * $Id: VelocityServlet.java,v 1.25 2001/03/13 03:52:06 geirm Exp $
  + * $Id: VelocityServlet.java,v 1.26 2001/03/16 04:50:57 geirm Exp $
    */
   public abstract class VelocityServlet extends HttpServlet
   {
  @@ -191,7 +194,7 @@
   
               Properties props = loadConfiguration( config );
     
  -            Runtime.init( props );
  +            Velocity.init( props );
               
               defaultContentType = DEFAULT_CONTENT_TYPE;
               
  @@ -454,9 +457,11 @@
           
           /*
            *   put the request/response objects into the context
  +         *   wrap the HttpServletRequest to solve the introspection
  +         *   problems 
            */
              
  -        context.put( REQUEST, request );
  +        context.put( REQUEST, new HttpServletRequestWrap( request ) );
           context.put( RESPONSE, response );
   
           return context;
  
  
  

Reply via email to