aspose file tools*
The moose likes Servlets and the fly likes Poblem with doPost() and doGet() method? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Poblem with doPost() and doGet() method?" Watch "Poblem with doPost() and doGet() method?" New topic
Author

Poblem with doPost() and doGet() method?

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

hi all,
i am new to servlets , i am trying some simple code of Servlet..
I am defining a HTML FORM code in servlets doGet() method , and retrieving a name that user submit through same Servlets doPost() method.
here is method that i defined :


The problem is , the FORM that servlet shows is correct , but when i submitted the form , rather getting HI {fname} , i am getting the same FORM again .

What ll be its solution ??

Thanks in advance.
[ March 04, 2008: Message edited by: Bear Bibeault ]

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41884
    
  63
Since the FORM tag does not have a method="POST" attribute, it is not not actually performing a POST, but a GET (which is the default in the absence of a method attribute).


Ping & DNS - my free Android networking tools app
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Thanks a ton , sir, My problem is solved. actully its my fault that i am not check the code fully , before posting it..

Thanks once again..
 
jQuery in Action, 2nd edition
 
subject: Poblem with doPost() and doGet() method?