Get/Post with JSP

C

chirs

Hi,

JSP getParametr() will get a value from the URL. When the form uses
mehtod=Post on the html page and user submit the form, are the input
values appended to the URL? I read a book saying so. But another
book says the input values are appended to the URL only when the form
uses mehtod=get.

Could you help me on this?

Chris
 
S

Sudsy

chirs said:
Hi,

JSP getParametr() will get a value from the URL. When the form uses
mehtod=Post on the html page and user submit the form, are the input
values appended to the URL? I read a book saying so. But another
book says the input values are appended to the URL only when the form
uses mehtod=get.

Could you help me on this?

Chris

The second book is correct: only on a GET are the parameters passed
as part of the URL.
 
W

Wendy S

chirs said:
JSP getParametr() will get a value from the URL. When the form uses
mehtod=Post on the html page and user submit the form, are the input
values appended to the URL? I read a book saying so. But another
book says the input values are appended to the URL only when the form
uses mehtod=get.

It's true that only GET will append the parameters to the URL so they'll be
visible in the browser window.

However... that doesn't mean that the 'getParameter' method won't work if
the data was POSTed to you. I'm sort of reading between the lines of your
message. You say, "getParameter() will get a value from the URL". That's
not entirely correct... getParameter() will retrieve a request parameter,
regardless of how it got to you, either GET or POST.

Hope that helps...
 
A

Andrew Thompson

Wendy S said:
....
...I'm sort of reading between the lines of your
message. You say, "getParameter() will get a value from the URL". That's
not entirely correct... getParameter() will retrieve a request parameter,
regardless of how it got to you, either GET or POST.

Thanks Wendy! That answers one of the 1001
nagging questions _I_ have at this moment.. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top