You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Jann Forrer <ja...@id.unizh.ch> on 2005/07/15 10:35:12 UTC

wrong redirect in login usecase

Hi

If i use tomcat (i.e. if lenya 1.4-dev is not deployed in the root
context)  I will be redirected to a non existing page e.g.
lenya/lenya/default/..... after login.

That seems to be due to

   setTargetURL(request.getRequestURI());

in Login.java and the url you will be redirected to is composed in
usecases.js as:
   var url = request.getContextPath() + targetUrl;
For the login usecase you therefore have one ContextPath too much.

Can we use

  setTargetURL(request.getPathInfo());

in Login.java instead? In that case you should get the right url in
usecases.js.

Jann

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: wrong redirect in login usecase

Posted by Andreas Hartmann <an...@apache.org>.
Jann Forrer wrote:
> Hi
> 
> If i use tomcat (i.e. if lenya 1.4-dev is not deployed in the root
> context)  I will be redirected to a non existing page e.g.
> lenya/lenya/default/..... after login.
> 
> That seems to be due to
> 
>    setTargetURL(request.getRequestURI());
> 
> in Login.java and the url you will be redirected to is composed in
> usecases.js as:
>    var url = request.getContextPath() + targetUrl;
> For the login usecase you therefore have one ContextPath too much.
> 
> Can we use
> 
>   setTargetURL(request.getPathInfo());
> 
> in Login.java instead? In that case you should get the right url in
> usecases.js.

+1

The only problem with getPathInfo() is that it might return null,
but this won't occur inside publications.

http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/environment/Request.html#getPathInfo()

You can as well use o.a.l.util.ServletHelper.getWebappURI(request)
(no idea which one to prefer)

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org