*
The moose likes Servlets and the fly likes Issue with POST and Forms Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Issue with POST and Forms" Watch "Issue with POST and Forms" New topic
Author

Issue with POST and Forms

Kenny Johnson
Ranch Hand

Joined: Jan 01, 2007
Posts: 37
I have this code:

html file


then inside of doGet for my servlet i have this:




The output is always null...
what the heck am i doing wrong? I want it to say light if the user chose light, dark if they pick dark etc ...

what little thing am i forgetting?
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
Did you mean inside of doPost?
vijay kumarg
Ranch Hand

Joined: Dec 14, 2006
Posts: 105
Kenny,
Your method attributes indicates the HTTP request is of type POST.
You should write the above logic in doPost() but not in doGet().
The default http request is GET.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issue with POST and Forms