cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alec Bickerton <alec.bicker...@minick.ch>
Subject Psuedo protocol as a action parameter causing problems
Date Mon, 04 Feb 2008 11:31:43 GMT
Hi,

I have simple action that takes 3 parameter and does a simple redirect 
based on the value of param1.

e.g.,

<map:match pattern="blah">
    <map:act type="SimpleAction">
	<map:parameter name="ua" value="{useragent}"/>
	<map:parameter name="one" value="http://somehost/someurl"/>
	<map:parameter name="two" value="http://somehost/someotherURL"/>
    </map:act>
</map:match>

Works perfectly, however the application I'm working on requires the use 
of cocoon:// as parameters.
The following fails as the cocoon://url cannot be properly resolved by 
the action.

<map:match pattern="blah">
    <map:act type="SimpleAction">
	<map:parameter name="ua" value="{useragent}"/>
	<map:parameter name="one" value="cocoon://someurl"/>
	<map:parameter name="two" value="cocoon://someotherURL"/>
    </map:act>
</map:match>


SimpleAction.java (Simplified for clarity)

public class SimpleAction extends AbstractAction {

public final Map act( final Redirector redirector, final SourceResolver 
resolver, final Map objectModel, final String source,final Parameters 
params) throws Exception {
String ua = "example";
String oneURL = "www.example.example/pass/";
String twoURL = "www.example.example/fail/";
   if( params.isParameter( "ua" ) )
        ua = params.getParameter( ua );
   if( params.isParameter( "one" ) )
        oneURL = params.getParameter( "one" );
   if( params.isParameter( "two" ) )
        twoURL = params.getParameter( "two" );
   if( ua.equals("something"))
	redirector.redirect( false, oneURL );
   else
	redirector.redirect( false, twoURL );
   return null;
}


Any ideas. Is there a mechanism that I can retrieve the absolute URL 
from the cocoon:// protocol from within an action.
Or am I missing some magic incantation on the redirector, that would let 
me use this type of URL.

Any help would be most appreciated.
Alec





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


Mime
View raw message