• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

get value from url

 
Bacchi Gerem
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

www.mywebsite.com/updateuser.jsp?username=xxxx?aptno=yyyyy

When someone click this url Its opens updateuser.jsp. There is an ACCEPT (submit) button inside the <FORM> on the screen and when we press the ACCEPT I am opening a servlet. On doGet I am trying to get the username and aptno with getparameter. But I am getting NULL values.

Can you please suggest me how to get those value from that URL to my servlet.

It will be great if you can point to some materail too.

Thanks in advacne
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Try to do like this.

http://www.mywebsite.com/updateuser.jsp?username=xxxx&aptno=yyyyy
[ October 30, 2005: Message edited by: Adeel Ansari ]
 
Bacchi Gerem
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou..I mean

http://www.mywebsite.com/updateuser.jsp?username=xxxx&aptno=yyyy

Whats happening is my url is getting change to

http://www.mywebsite.com/Sherwood/updateuser?submit=Accept, when I am pressing Accept button. So my servlet getparameter() return null value.

Please suggest...

Thanks
 
Eddy Lee Sin Ti
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Common practices include making the parameters you want to include in the form submission as hidden form fields. Or, you can store the parameters in a session scope java bean. There are other methods like storing in database or cookies, but all of them got pros and cons you might need to consider.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly what is the code you are using to try to get a parameter from that URL?
A single misspelling or difference in UPPER/lower case use will cause you to get a null value.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic