This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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.
 
wood burning stoves
 
subject: Issue with POST and Forms
 
Similar Threads
HTTP Status 404 Error
HFS: Problem with deploying and testing Beer-v1 App
Problem getting the Beer Selection Page screen shot
servlet programming problem in Eclipse
HFSJ 2nd edition page 75