You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Zsolt <zk...@intland.com> on 2005/10/30 19:34:50 UTC

How to get the original URI from taglib?

Hi,

How can I figure out the origial URI (from a JSP taglib). I have tried
request.getPathInfo() and request.getRequestURI() but I get wrong values.

For example if my URI was http://localhost:8080/abcdef.do I would like to
get /abcdef.do.

I use tc-5.5.12.

Zsolt



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to get the original URI from taglib?

Posted by Yujun Liang <yu...@acm.org>.
 please try
 request.getServletPath()

 On 10/31/05, Zsolt <zk...@intland.com> wrote:
>
> Hi,
>
> How can I figure out the origial URI (from a JSP taglib). I have tried
> request.getPathInfo() and request.getRequestURI() but I get wrong values.
>
> For example if my URI was http://localhost:8080/abcdef.do I would like to
> get /abcdef.do.
>
> I use tc-5.5.12.
>
> Zsolt
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


--
Yujun Liang
yujun.liang@acm.org

Re: How to get the original URI from taglib?

Posted by Laurie Harper <la...@holoweb.net>.
Zsolt wrote:
> Hi,
> 
> How can I figure out the origial URI (from a JSP taglib). I have tried
> request.getPathInfo() and request.getRequestURI() but I get wrong values.
> 
> For example if my URI was http://localhost:8080/abcdef.do I would like to
> get /abcdef.do.
> 
> I use tc-5.5.12.
> 
> Zsolt

The short answer is: it depends :-)

To be precise, it depends on how the request was processed up to the 
point where you want to access the original URI. It turns out, there 
isn't a reliable way to do this unless you can make certain guarantees 
about what includes and forwards may have happened already.

I had the same question a few days ago. See that thread for more details:

http://www.mail-archive.com/user@struts.apache.org/msg36082.html

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org