You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Felipe Ibanez <ji...@si.ehu.es> on 2003/04/07 19:58:11 UTC
Problems with Views and redirect-to
Hi,
I am developing an example of a portal using cocoon. The idea is to use
an application inside another one, in the same way as the given example of
WSProxyGenerator by Cocoon. The application that I am using is the given
example of "authentication-fw". The first change I have made in the
sitemap of this is to add the ability to return xml view. Adding a new
view in the sitemap and a label in the transformer of the pipeline that
match with 'protected'. Here is the example:
<!-- ========================================= -->
<!-- Form target which performs auth service -->
<!-- ========================================= -->
<map:match pattern="do-login">
<!-- try to login -->
<map:act type="auth-login">
<map:parameter name="handler" value="demohandler"/>
<map:parameter name="parameter_name"
value="{request-param:username}"/>
<map:redirect-to uri="protected" />
</map:act>
<!-- something was wrong, try it again -->
<map:redirect-to uri="login"/>
</map:match>
<!-- ================ -->
<!-- Protected area -->
<!-- ================ -->
<map:match pattern="protected">
<map:act type="auth-protect">
<map:parameter name="handler" value="demohandler"/>
<map:generate src="docs/protected.xml"/>
<map:transform src="stylesheets/simple-page2html.xsl"/>
<map:transform type="encodeURL" label="xml"/>
<map:serialize />
</map:act>
<!-- something was wrong, redirect to login page -->
<map:redirect-to uri="login"/>
</map:match>
The problem comes when I request the 'do-login' but the returned format
that I want is XML. Here is the request:
http://localhost:8080//cocoon/samples/authentication-fw/
do-login?cocoon-view=xml&username=cocoon
But the response send back by cocoon is HTML.
I know that cocoon redirects the request to protected area when the
username is valid and this works, but in this redirection the request of
cocoon-view=xml has been losen and responds in HTML format.
Because of that, I can´t use the request above in the wsproxy generator.
It gives an execution error message: Invalid response - no xml.
Does anybody know how to resolve this problem?
Thanks in advanced.
-------------------------------------------
Felipe Ibáñez Anfurrutia
Deparment of Computer Languages and Systems
Computer Engineering Faculty
University of the Basque Country
Apdo. 649
20080 - San Sebastian (Spain)
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org