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: 39549
    
  27
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 - updated with new look and Ping home screen widget
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..
 
 
subject: Poblem with doPost() and doGet() method?
 
Similar Threads
passing hidden forms problem
Problem regarding redirected error message
newbie question about servlets calling methods
form data
The requested resource () is not available