velocity-user mailing list archives

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

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:

#snip()

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
exist.

> 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
    #end

-Bill

--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message