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 Poblem with doPost() and doGet() method? 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 "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: 41089
    
  44
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..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Poblem with doPost() and doGet() method?
 
Similar Threads
form data
newbie question about servlets calling methods
passing hidden forms problem
The requested resource () is not available
Problem regarding redirected error message