You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Elijah Zupancic (JIRA)" <ji...@apache.org> on 2012/07/26 19:31:34 UTC

[jira] [Resolved] (CHAIN-47) WebContext, ServletWebContext should be interfaces.

     [ https://issues.apache.org/jira/browse/CHAIN-47?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Elijah Zupancic resolved CHAIN-47.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0

Resolved on 1366094.
                
> WebContext, ServletWebContext should be interfaces.
> ---------------------------------------------------
>
>                 Key: CHAIN-47
>                 URL: https://issues.apache.org/jira/browse/CHAIN-47
>             Project: Commons Chain
>          Issue Type: Improvement
>    Affects Versions: 1.0, 1.1, 1.2
>         Environment: n/a
>            Reporter: ori
>             Fix For: 2.0
>
>
> WebContext should not be an abstract class.  ServletWebContext should not be a concrete class. 
> Different applications may want to have different base implementations of context but still have WebContext methods. A perfect example is in Struts 1.3: WebActionContext and ServletActionContext duplicate many of the methods in their chain equivalents without adhering to a common interface.
> I use the classes below in my application. Most Commons projects do not use the "IXxxx"  interface naming convention but I had no choice here.
> public interface IWebContext extends Context
> {
>     public Map getApplicationScope();
>     public Map<String, String> getHeader();
>     public Map<String, String[]> getHeaderValues();
>     public Map<String, String> getInitParam();
>     public Map<String, String> getParam();
>     public Map<String, String[]> getParamValues();
>     public Map getRequestScope();
>     public Map getSessionScope();
> }
> public interface IServletWebContext extends IWebContext
> {
>     public ServletContext getContext();
>     public Map<String, Cookie> getCookies();
>     public Cookie deleteCookie( final String cookieName );
>     public HttpServletRequest getRequest();
>     public HttpServletResponse getResponse();
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira