You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Rice Yeh (JIRA)" <ji...@apache.org> on 2007/07/07 21:49:04 UTC

[jira] Updated: (COCOON-2038) Implement true Object Oriented approach for handling super calls

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

Rice Yeh updated COCOON-2038:
-----------------------------

    Attachment: cocoon-servlet-service-impl.patch

Hi,
  I am sorry for delaying so long to reply your messages because I has been too busy for the past 2 weeks.
The following is the description of my implementation:
 
  I use the same reason as described by Daniel above to implement this function. However, in addition to
the returned status code, I also use ServletException to tell that a function might be implemented in a super
servlet service. Lets say servlet service s1 extends servlet service s0. A request r asking for functin f is handled
by s1 unsuccessfully because either an instance of ServletException is thrown or the returned status code
is not between 200 to 399, r is then handled by s0. The code is implemented in method 'forward' method of the
inner class PathDispatcher of ServletServiceContext.

  However, since there is not a method getStatus() in HttpServletResponse, I define a new interface called
StatusRetrievableResponse which just contains a method getStatus(). Then I change the method 'service'
in DispatcherServlet to wrapp the passed-in repsonse 'rep' to make the response implement StatusRetrievableResponse
in order to let getting status possible in the method 'forward' in PathDispatcher.

  On the implementation, I find 2 bugs in ServletServiceContext. The first one is in the method
getNamedContext in ServletServiceContext. It does not look up super servlet for a named connection.
The second one is in the constructor of the inner class NamedDispatcher of the ServletServiceContext.
I have to use an example to tell this bug. Let say the above servlet service s0 have a link (but not a super link)
to another servlet service s3. When s1 invokes s3, current implementation treats this invocation as super invocation. I think
this is not right. So I remove some lines of code which doing the supperCall setting in the NamedDispatcher constructor.

I attach one file patch this time.

Regards,
Rice

> Implement true Object Oriented approach for handling super calls
> ----------------------------------------------------------------
>
>                 Key: COCOON-2038
>                 URL: https://issues.apache.org/jira/browse/COCOON-2038
>             Project: Cocoon
>          Issue Type: Task
>          Components: - Servlet service framework
>            Reporter: Grzegorz Kossakowski
>            Assignee: Grzegorz Kossakowski
>             Fix For: 2.2-dev (Current SVN)
>
>         Attachments: BlockCallHttpServletResponse.java.patch, cocoon-servlet-service-impl.patch, DispatcherServlet.java.patch, ServletServiceContext.java.patch, StatusRetrievableResponse.java
>
>
> As discussed here: http://thread.gmane.org/gmane.text.xml.cocoon.devel/72317 implementation of super calls should be changed to make it more OO-like.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.