my dog learned polymorphism
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "Issue with POST and Forms" Watch "Issue with POST and Forms" New topic

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: 2398
Did you mean inside of doPost?
vijay kumarg
Ranch Hand

Joined: Dec 14, 2006
Posts: 105
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:
subject: Issue with POST and Forms
It's not a secret anymore!