Get/Post with JSP

  • Follow


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
0
Reply yma2037 (32) 12/17/2003 10:32:22 PM

chirs wrote:
> 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.

0
Reply bitbucket44 (1434) 12/17/2003 11:01:12 PM


"chirs" <yma@kicon.com> wrote
> 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...

-- 
Wendy in Chandler, AZ


0
Reply wendywds (276) 12/17/2003 11:11:44 PM

"Wendy S" <wendywds@hotmail.com> wrote in message
news:brqnrq$bmu$1@news.asu.edu...
> "chirs" <yma@kicon.com> wrote
> > ...But another
> > book says the input values are appended to the URL only when the form
> > uses mehtod=get.
....
> ...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..   :-)


0
Reply andrew64 (666) 12/18/2003 5:04:56 AM

3 Replies
33 Views

(page loaded in 2.939 seconds)

Similiar Articles:













6/28/2012 8:40:37 PM


Reply: