cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Bekema" <Nico.Bek...@ctp.com>
Subject RE: redirect-to with uri from action
Date Wed, 22 Jan 2003 22:42:33 GMT
thx Geoff.
You are absolutely right.

>>> cocoon@leverageweb.com 01/22/03 11:42PM >>>

From:	cocoon@leverageweb.com
Sent:	Wednesday, January 22, 2003 11:42 PM
To:	<cocoon-users@xml.apache.org>
Subject:	RE: redirect-to with uri from action
Priority:	Normal

unless you have a typo below, you've put your redirect outside the
map:act
which is only executed in the event the action fails, so this pattern
can't
win: either the action is successful and you have no pipeline elements
defined (generator and serializer are manditory) or your action fails
and
the value {value} should be undefined.

i haven't even looked at anything else in the message.

Geoff

> -----Original Message-----
> From: Nico Bekema [mailto:Nico.Bekema@ctp.com] 
> Sent: Wednesday, January 22, 2003 5:05 PM
> To: cocoon-users@xml.apache.org 
> Subject: redirect-to with uri from action
>
>
> Hi all,
>
> I would like to use a redirect-to in the sitemap using a uri that
> results from an action.
> Unfortunately it results in an Exception. I hope somebody can help
me.
>
> The entry in the sitemap looks like this:
>
> <map:match pattern="*">
>     <map:act type="myAction">
>         <map:parameter name="param" value="myValue"/>
>     </map:act>
>     <map:redirect-to session="false" uri="{value}"/>
> </map:match>
>
> The code in the action is as follows:
>
> Context ctx = ObjectModelHelper.getContext(objectModel);
> try {
>     String sParam = params.getParameter("param");
>     sValue = ctx.getInitParameter(sParam);
> } catch (ParameterException e) {
>    sValue = " ";
> }
> Map map = new HashMap();
> map.put("value", sValue);
> return map;
>
> The exception is:
> ERROR   (2003-01-22) 22:40.36:636   [access] (Unknown-URI)
> Unknown-thread/CocoonServlet: Cocoon servlet threw an Exception
while
> trying to close stream.
> java.io.IOException: The stream has been closed
> 	at
> org.apache.catalina.connector.ResponseStream.flush(ResponseStream.
> java:237)
> 	at
>
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1166)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(A
pplicationFilterChain.java:247)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicati
> onFilterChain.java:193)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapp
> erValve.java:243)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:566)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:472)
> 	at
>
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardConte
> xtValve.java:190)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:566)
> 	at
> org.apache.catalina.valves.CertificatesValve.invoke(CertificatesVa
> lve.java:246)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:564)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:472)
> 	at
>
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
>
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValv
> e.java:180)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:566)
> 	at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispat
> cherValve.java:170)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:564)
> 	at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValv
> e.java:170)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:564)
> 	at
>
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:564)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:472)
> 	at
>
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngine
> Valve.java:174)
> 	at
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipel
> ine.java:566)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.
> java:472)
> 	at
>
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
>
org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)
> 	at
> org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
> 	at java.lang.Thread.run(Thread.java:536)
>
> any help is appreciated,
>
> thx,
> Nico
>
>
>
>
---------------------------------------------------------------------
> Please check that your question  has not already been answered in
the
> FAQ before posting.    
<http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:    
<cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:  
<cocoon-users-help@xml.apache.org>
>
>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message