cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ias" <iasan...@apache-korea.org>
Subject RE: Flow and InvalidContinuation Redirect
Date Fri, 02 May 2003 03:47:34 GMT
I applied http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19526 patches to
the latest cocoon-2.1 CVS. I tested them under Stefano's Linotype with the
following sitemap.xmap

  <map:selectors default="exception">
   <map:selector name="exception" logger="sitemap.selector.exception"
src="org.apache.cocoon.selection.ExceptionSelector">
     <exception name="not-found"
class="org.apache.cocoon.ResourceNotFoundException"/>
     <exception name="invalid-continuation"
class="org.apache.cocoon.components.flow.InvalidContinuationException"/>
     <exception class="java.lang.Throwable" unroll="true"/>
   </map:selector>
  </map:selectors>

...

  <map:handle-errors>
    <map:select type="exception">
      <map:when test="not-found">
        <map:generate type="jxpath" src="screens/notfound.jxpath"/>
      </map:when>
        <map:when test="invalid-continuation">
        <map:generate type="jxpath" src="screens/notfound.jxpath"/>
        </map:when>
      <map:otherwise>
        <map:generate type="notifying"/>
        <map:transform src="stylesheets/system/error2html-debug.xslt">
         <map:parameter name="uri" value="{request:requestURI}"/>
         <map:parameter name="home" value="{global:home}"/>
        </map:transform>
      </map:otherwise>
    </map:select>
    <map:serialize/>
  </map:handle-errors>

In case that news2edit.xslt has 

     <form name="data" action="{string('{$continuation/id}')}.kont"
method="POST" enctype="multipart/form-data">

which brings out an invalid continuation, the result is 

Internal Server Error

Message: null

Description: No details available.

Sender: org.apache.cocoon.servlet.CocoonServlet

Source: Cocoon Servlet

Request URI

private/edit/news/9/{$continuation/id}.kont

cause

The continuation ID id} is invalid.

request-uri

/linotype/private/edit/news/9/%7B$continuation/id%7D.kont

Apache Cocoon 2.1-M2-dev

, which is not desired by the above sitemap setting. I guess CocoonServlet
delegates the report job to its manageException method that uses
DefaultNotifyingBuilder to display the error screen. (In contrast,
"not-found" test works well with jxpath generate, e.g. requesting
http://localhost:8080/linotype/aaa .)

Ias.

> -----Original Message-----
> From: Tony Collen [mailto:tcollen@neuagency.com]
> Sent: Friday, May 02, 2003 5:01 AM
> To: cocoon-dev@xml.apache.org
> Subject: Re: Flow and InvalidContinuation Redirect
> 
> 
> On Thu, 1 May 2003, Stefano Mazzocchi wrote:
> 
> > on 4/30/03 10:14 PM Tony Collen wrote:
> >
> > > Hi everybody,
> > >
> > > All the talk on allowing redirects in <map:handle-errors>, along
> > > with the stuff I've been doing with the Flow layer got me to 
> > > thinking:
> > >
> > > Should we be handling invalidContinuation inside handle-errors
> > > instead of automagically activating the 
> "invalidContinuation" URI in
> > > the pipeline?
> >
> > YES!!!!!!
> >
> > That invalidContinuation hardwired sucks.
> 
> Patch submitted... I've tested the calculator flow sample
> with the following, and it seems to work:
> 
>   <map:handle-errors>
>     <map:select type="exception">
>         <map:when test="invalid-continuation">
>             <map:generate src="../invalidContinuation.xml"/>
>             <map:serialize type="xml"/>
>         </map:when>
>     </map:select>
>   </map:handle-errors>
> 
> 
> This is of course after adding
> org.apache.cocoon.components.flow.InvalidContinuationException
>  to the ExceptionSelector config in the sitemap.
> 
> 
> 
> Tony
> 
> 
> 
> 
> --
> Tony Collen
> ICQ: 12410567
> --
> Cocoon: Internet Glue (A Cocoon Weblog) http://manero.org/weblog/
> --
> 
> 


Mime
View raw message