File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Extract information form URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Extract information form URL" Watch "Extract information form URL" New topic

Extract information form URL

meraj zia

Joined: Apr 17, 2009
Posts: 5

My application context root is '/rr/la' and my login page is '/login.xhtml'. But i need to extract some information from the URL. So the request can come like ''.

I need to extract 'abcd/efgh'. Extraction is easy. But my problem is that when i do 'request.getRequestURI()' in my Servlet Filter it gives me '/rr/la/login.xhtml' rather that '/rr/la/abcd/efgh/login.xhtml'.

How to get this information.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1506
Have you tried request.getPathInfo?

So much trouble in the world -- Bob Marley
meraj zia

Joined: Apr 17, 2009
Posts: 5
Ya i've it's returning me null.

Please find the mapping below

I agree. Here's the link:
subject: Extract information form URL
Similar Threads
what difference '\' and '/'
new to servlets, need help !
False Coin
how to parse a string
BufferedReader Problem