velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Burton <>
Subject Re: [off topic] WebWorkVelocityServlet
Date Thu, 11 Jul 2002 00:56:59 GMT

Part of these questions are rather general to Velocity not too WebWork
specific so I'll try and answer them here ...

"G.L. Grobe" wrote:


The WebWorkVelocityServlet extends VelocityServlet.  As a result it also
exposes the HttpServletRequest object in the Velocity context as $req.  So
there's nothing extra you need to do to access request parameters within a
Velocity template--just call $req.getParameter("foo") or whatever methods
you want to call.  

With code below, a NullPointerException would be thrown if myParam doesn't

> By using this, I understand that I can write the following in my velocity
> templates ...
>    #if ( $reqParser.getParameter("myParam").equals("this_string") )
>       ## do something
>    #end

Instead, do this ...
    #if ( $req.getParameter("myParam") == "this_string" )
        ## do something


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message