You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Sgarlata Matt <sg...@bah.com> on 2003/09/28 23:45:35 UTC

[Chain] WebServletContext constructor is redundant

I think the constructor for
org.apache.commons.chain.web.servlet.ServletWebContext
has a redundant parameter.  Here is the signature:

public ServletWebContext(javax.servlet.ServletContext context,
                         javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)

The ServletContext can be retrieved from the request, with
request.getSession().getServletContext() right?  Can I submit a patch to
remove the ServletContext parameter?  Looking through the Chain code, it
looks like the
org.apache.commons.chain.web.servlet.ServletSetLocaleCommandTestCase will be
broken by this change, so if I submit a patch I will patch this file as
well, and possibly the MockServletRequest, etc. that this test case depends
on.

Matt


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [Chain] WebServletContext constructor is redundant

Posted by "Craig R. McClanahan" <cr...@apache.org>.
Sgarlata Matt wrote:

>I think the constructor for
>org.apache.commons.chain.web.servlet.ServletWebContext
>has a redundant parameter.  Here is the signature:
>
>public ServletWebContext(javax.servlet.ServletContext context,
>                         javax.servlet.http.HttpServletRequest request,
>                         javax.servlet.http.HttpServletResponse response)
>
>The ServletContext can be retrieved from the request, with
>request.getSession().getServletContext() right?
>
Only in a Servlet 2.4 or later environment.  It also requires the 
creation of a session if there wasn't one before, and that's not going 
to be desireable, so -1 on changing this.

>  Can I submit a patch to
>remove the ServletContext parameter?  Looking through the Chain code, it
>looks like the
>org.apache.commons.chain.web.servlet.ServletSetLocaleCommandTestCase will be
>broken by this change, so if I submit a patch I will patch this file as
>well, and possibly the MockServletRequest, etc. that this test case depends
>on.
>
>Matt
>  
>
I'm half way through implementing Context "as a" Map instead of "has a" 
Map.  After I get done with that, I'll look at ChainServlet and 
ChainAction (the latter should probably end up in the Struts 
contrib/struts-chain repository, right?).

Craig

>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [Chain] WebServletContext constructor is redundant

Posted by "Craig R. McClanahan" <cr...@apache.org>.
Sgarlata Matt wrote:

>I think the constructor for
>org.apache.commons.chain.web.servlet.ServletWebContext
>has a redundant parameter.  Here is the signature:
>
>public ServletWebContext(javax.servlet.ServletContext context,
>                         javax.servlet.http.HttpServletRequest request,
>                         javax.servlet.http.HttpServletResponse response)
>
>The ServletContext can be retrieved from the request, with
>request.getSession().getServletContext() right?
>
Only in a Servlet 2.4 or later environment.  It also requires the 
creation of a session if there wasn't one before, and that's not going 
to be desireable, so -1 on changing this.

>  Can I submit a patch to
>remove the ServletContext parameter?  Looking through the Chain code, it
>looks like the
>org.apache.commons.chain.web.servlet.ServletSetLocaleCommandTestCase will be
>broken by this change, so if I submit a patch I will patch this file as
>well, and possibly the MockServletRequest, etc. that this test case depends
>on.
>
>Matt
>  
>
I'm half way through implementing Context "as a" Map instead of "has a" 
Map.  After I get done with that, I'll look at ChainServlet and 
ChainAction (the latter should probably end up in the Struts 
contrib/struts-chain repository, right?).

Craig

>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>  
>