permaculture playing cards
The moose likes Servlets and the fly likes get value from url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "get value from url" Watch "get value from url" New topic

get value from url

Bacchi Gerem
Ranch Hand

Joined: Jan 23, 2004
Posts: 120

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

Joined: Aug 15, 2004
Posts: 2874

Try to do like this.
[ October 30, 2005: Message edited by: Adeel Ansari ]
Bacchi Gerem
Ranch Hand

Joined: Jan 23, 2004
Posts: 120
Thankyou..I mean

Whats happening is my url is getting change to, when I am pressing Accept button. So my servlet getparameter() return null value.

Please suggest...

Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
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.

SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="" target="_blank" rel="nofollow"></a>
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
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.
I agree. Here's the link:
subject: get value from url
It's not a secret anymore!