You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tobia Conforto <to...@linux.it> on 2007/07/25 10:58:16 UTC

Disable url rewriting

Does anybody know how to disable url encoding in Cocoon on Jetty?

For a certain web application I want sessions to be handled only through
cookies (and not to work when cookies aren't available.)

Is it a Cocoon or a Jetty configuration parameter?


Tobia

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


Re: Disable url rewriting

Posted by Tobia Conforto <to...@linux.it>.
Nevermind, something was (is) creating spurious sessions where it
shouldn't.  It will take a while to figure out what misguided component
or piece of flowscript is doing so.

In the meantime I have put this in a couple places to make sure there is
no session before calling redirectTo():

if (cocoon.request.getSession(false))
  cocoon.session.invalidate()

Otherwise redirectTo, which ends up calling response.encodeRedirectURL()
(in HttpEnvironment.java:138) will add ;jsessionid to the URL.


Tobia

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


Re: Disable url rewriting

Posted by Ralph Goers <Ra...@dslextreme.com>.
The jsessionid is managed by the servlet container. My understanding is 
that it detects whether the use supports cookies and if so uses a 
cookie. Otherwise it is sent as you see here. I know of no way to change 
this.  What you probably need is a bit of javascript on the page to 
detect whether cookies are enabled and then cause an error message in 
the browser. You should do this before the session is even created.

Tobia Conforto wrote:
> Let me explain the problem a bit more.
> I'm still curious about the issue, although I've found a workaround.
>
> According to the docs Cocoon will not rewrite URLs, unless you use the
> encodeURL transformer or call the equivalent flowscript function.
>
> What I'm seeing is that the Location header of a client-side redirect
> gets rewritten somewhere between my flowscript call and the network.
>
> I call:
>
> 	cocoon.redirectTo('test')
>
> And on the wire I see:
>
> 	Location: http://my.server/test;jsessionid=xxxxxxxxxx
>
> Who is rewriting the URL?  Cocoon or Jetty?  How can I disable it?
>
>
> The workaround I've found is calling redirectTo like this:
>
> 	cocoon.redirectTo('http://my.server/test', true)
>
> With both a full URL as the first parameter and true as the second one,
> the Location URL doesn't get rewritten.
>
>
> Tobia
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>   

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


Re: Disable url rewriting

Posted by Baptiste Placé <bo...@free.fr>.
Tobia,

I do not know about your problem, but in my application I used redirect 
like :
cocoon.redirectTo("", true);
or
cocoon.redirectTo("viewcoincoin?coincoin=duck",true);
Never had a problem with those redirect, it would redirect to 
"localhost/cocoon/myappli/" + first parameter everytime.

Baptiste

Tobia Conforto a écrit :
> Let me explain the problem a bit more.
> I'm still curious about the issue, although I've found a workaround.
>
> According to the docs Cocoon will not rewrite URLs, unless you use the
> encodeURL transformer or call the equivalent flowscript function.
>
> What I'm seeing is that the Location header of a client-side redirect
> gets rewritten somewhere between my flowscript call and the network.
>
> I call:
>
> 	cocoon.redirectTo('test')
>
> And on the wire I see:
>
> 	Location: http://my.server/test;jsessionid=xxxxxxxxxx
>
> Who is rewriting the URL?  Cocoon or Jetty?  How can I disable it?
>
>
> The workaround I've found is calling redirectTo like this:
>
> 	cocoon.redirectTo('http://my.server/test', true)
>
> With both a full URL as the first parameter and true as the second one,
> the Location URL doesn't get rewritten.
>
>
> Tobia
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>   

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


Re: Disable url rewriting

Posted by Tobia Conforto <to...@linux.it>.
Let me explain the problem a bit more.
I'm still curious about the issue, although I've found a workaround.

According to the docs Cocoon will not rewrite URLs, unless you use the
encodeURL transformer or call the equivalent flowscript function.

What I'm seeing is that the Location header of a client-side redirect
gets rewritten somewhere between my flowscript call and the network.

I call:

	cocoon.redirectTo('test')

And on the wire I see:

	Location: http://my.server/test;jsessionid=xxxxxxxxxx

Who is rewriting the URL?  Cocoon or Jetty?  How can I disable it?


The workaround I've found is calling redirectTo like this:

	cocoon.redirectTo('http://my.server/test', true)

With both a full URL as the first parameter and true as the second one,
the Location URL doesn't get rewritten.


Tobia

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