On 7/11/07, Daniel Dekany <[EMAIL PROTECTED]> wrote:
Wednesday, July 11, 2007, 4:24:01 PM, Robert Koberg wrote:

> Hi,
>
> What are the cons of simply using the (Http)ServletRequest object to
> store objects for a view template. Or, why use a velocity context when
> you already have the request object?

Velocity is not bound to Servlet-s or HTTP... it may be used to
generate text in applications that has nothing to do with the Web. So
it can't just use the ServletRequest as the context by default. If it
can use the HTTP request directly as the context if you want that, I
don't know... there is a template engine that can, but I won't tell
it's name. ;)

All incarnations of the VelocityViewServlet (and kin) provide
transparent, out-of-the-box access to all request attributes (and
more) in the context.  The request doesn't so much operate as the
context, as it does serve to back the context (along with the session
& servlet context) in a chained lookup.

> I am thinking of reuse of control logic for different view template
> engines. Or different control languages with the same velocity
> templates. But really I am looking for any negatives for using only the
> request object.
>
> It seems to me if you stick to populating only the request object you
> have a much greater ease of changing/adapting/whathaveyou.
>
> thanks,
> -Rob

--
Best regards,
 Daniel Dekany


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to