I've always been a little unclear about what RequestUtils' role should be. Passing in the ServletContext is redundant because (at least in servlet 2.3) you can get the session from the request and the ServletContext from the session.

David






From: Anthony Kay <[EMAIL PROTECTED]>
Reply-To: "Struts Developers List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: The RequestUtils interface
Date: Sun, 2 Feb 2003 12:50:53 -0800 (PST)


I have recently started working with the velocity tools for struts
in order to add struts 1.1 support. I've noticed that almost all of
the code that does real work is simply a re-write of what is in
the existing struts RequestUtils class.

The problem is that the methods of RequestUtils were written to take
a PageContext in order to get the request, session, and applet context
objects, which is fine for JSP custom tag support, but display tools
for non-JSP systems do not have a PageContext.

My suggestion (and I am willing to contribute the code) is to add
methods to the interface of RequestUtils that accept the request,
servlet context, etc. as parameters. The work code would migrate to
these, and the existing methods would extract the pieces from the
PageContext and delegate.

For example:

ModuleConfig getModuleConfig(PageContext pageContext)
{
   return getModuleConfig(pageContext.getRequest(),
                          pageContext.getServletContext());
}

ModuleConfig getModuleConfig(HttpServletRequest request,
                             ServletContext application)
{
   // existing code in RequestUtils, using new parameter names
}

Comments?

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail


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

Reply via email to