• Post Reply Bookmark Topic Watch Topic
  • New Topic

url data into variable

 
Bill Brasskey
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I take form data from a URL and put it in a string variable?...Of course I know to use request.getParameter to get form data that's in the body of the HTTP request using "post", but that doesn't apply to what I'm asking. I have a link that I append data into ex. index.jsp?id=<%=id%> etc...
I just want to take the values and place them in a string in the page i'm linking to to use elsewhere in the page...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question is not very clear, but I don't see how request.getParameter() is not your answer.
 
Chad McGowan
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to use request.getQueryString(), if you want to see the whole request string. This will return a String with everything after the ? in your url....
[ July 08, 2004: Message edited by: Chad McGowan ]
 
Faris Syed
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does'nt matter, post or get you can use same method to get the data.
in your case u can use:
String id_ = request.getParameter("id");
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!