aspose file tools*
The moose likes Servlets and the fly likes How to get url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to get url" Watch "How to get url" New topic
Author

How to get url

avneesh atri
Greenhorn

Joined: Jul 18, 2011
Posts: 20
Hi,
i am trying to deploy a web application on another Website's iframe , when i travese from one page to another page , the url changes. There are some parameters added in the url which i want to acces but i am not able to .

i have used request.getParameter(), request.getQueryString() but these both methods return me null values

when i do request.getRequestUrl() it gives me my local web address not the address which is actually coming in the web browser. i.e.

if my actual url is http://localhost:8080/maapp/ and the hosting url is http://xyz.com/maapp/#name="rohit"&age="34"

on running request.getRequestUrl() i get http://localhost:8080/maapp/ hence i am not able to access these name and age params.

Help me with these please.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Those are not URL parameters. The URL parameter part starts with a "?", but since this URL has no question mark, there are no parameters.
avneesh atri
Greenhorn

Joined: Jul 18, 2011
Posts: 20
Tim Moores wrote:Those are not URL parameters. The URL parameter part starts with a "?", but since this URL has no question mark, there are no parameters.



the problem still remains ,how can i access these values from a servlet
ronney singh
Ranch Hand

Joined: Feb 10, 2012
Posts: 40

First find out why "?" is not coming in your URL if you are sending parameters.


Live Life King Size
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
IIRC, then the browser is not obliged to send anything following the hash character ("#") to the server; that's purely a client-side thing. So if you can't fix the URLs to include proper parameters, you may be out of luck.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get url