This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I want to enter a user name and password in an html page and use doPost method in one servlet and if the user name and password is correct then I want to forward to another servlet.
The following is my code in this attempt.
<html> <body> <form action = "servlet/Firstservlet" method = "post"> please enter your name <input type = "text" name = "name"> please enter your password <input type = "password" name = "password"> </form> </body> </html>
Thanks for your wonderful advice. It will be a great help to me in the future in debugging. But I can't get where the SOP will be printed? I have checked the Tomcat screen and could't find any messages.
FYI I am using a short cut for starting and shutting down Tomcat and cannot see any messages.
Joined: Nov 29, 2005
I think that is the reason.If your flow would have reached then you probably might have seen SOP on console.No SOP means your flow has not been encountered. Did the tomcat log help you.Did you see something there.
Ashwin, As you are putting FirstServlet in classes/servlet folder, it can be reached by passing through its package, in this case it should be accessed in the form of servlet.FirstServlet, change the entry in <servlet-class>Firstservlet</servlet-class> to <servlet-class>servlet.Firstservlet</servlet-class> & include package statement in corresponding class file(i.e package servlet)
Hope this solves the issue [ September 16, 2006: Message edited by: ArunChidam ]
Arun Chidambaram<br />SCJP1.4, SCWCD1.5
Joined: Nov 29, 2005
Yes Ashwin , Arun C has the catch.While writing the servlet you are using the default package but you are putting the classes in /classes/servelt which is like the package of the classes is servlet(which is not true).
What you can do is recompile the java classes with package servlet; and follow the usual steps.