Re: [Webwork-devel] velocity predefined context
Brought to you by:
baldree,
rickardoberg
|
From: <Jim...@do...> - 2002-07-09 12:14:46
|
The only problem would be the pain it causes those of us who have used the
velocity contexts already. Even though our action is not RequestAware, it
is useful to use the $req to provide debug information on the generated
page.
I don't see that this "interferes" with the WebWork API. It simply
augments the choices available to the developer.
jim
Marc Logemann <dev...@lo...>
Sent by: web...@li...
07/08/2002 06:08 PM
To: web...@li...
cc:
Subject: [Webwork-devel] velocity predefined context
Hi,
as WW uses the VelocityServlet as base class for its own
WebWorkVelocityServlet
for rendering the html, i wonder if its too good to have the pre-defined
ServletRequest ($req) and ServletResponse ($res) in the velocityContext,
because this will interfere with the WW marker interfaces RequestAware and
ResponseAware. Even i like the predefined objects in context in velocity
standalone mode, i want to question them in WW-context.
In detail, even if you dont implement one of those markers, you can easily
get the full request object in the view via $req, so the designer can do
things like
$req.getParameter("myparm") or whatever without knowledge of the
backend-programmer
(cause he never implemented RequestAware).
This violates the "give the designer a predefined API" rule, cause the API
is no longer
clearly defined.
So basically i am speaking of:
protected Context createContext(javax.servlet.http.HttpServletRequest
request,
javax.servlet.http.HttpServletResponse
response)
{
Context ctx = new
WebWorkVelocityContext(ValueStack.getStack(request));
ctx.put(REQUEST, request);
ctx.put(RESPONSE, response);
return ctx;
}
its about these 2 puts....
---
Marc Logemann
(see him @ www.logemann.info)
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Oh, it's good to be a geek.
http://thinkgeek.com/sf
_______________________________________________
Webwork-devel mailing list
Web...@li...
https://lists.sourceforge.net/lists/listinfo/webwork-devel
|