Commons Chain
  1. Commons Chain
  2. CHAIN-47

WebContext, ServletWebContext should be interfaces.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0, 1.1, 1.2
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      n/a

      Description

      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();
      }

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1314d 20h 3m 1 Elijah Zupancic 26/Jul/12 18:30
        Elijah Zupancic made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0 [ 12317844 ]
        Resolution Fixed [ 1 ]
        Hide
        Elijah Zupancic added a comment -

        Resolved on 1366094.

        Show
        Elijah Zupancic added a comment - Resolved on 1366094.
        ori created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            ori
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development