Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get url

 
avneesh atri
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2802
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 40
IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First find out why "?" is not coming in your URL if you are sending parameters.
 
Tim Moores
Bartender
Posts: 2802
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic