Hi,
Method doPost is called by the service method of this class to
handle an HTTP POST operation, while Method doGet is called to
handle an HTTP GET operation. In the FORM definition of your,
the METHOD is "GET". Please try doGet.
> Date: Tue, 15 Feb 2000 12:26:21 -0800
> From: Andrew Ahnn <[EMAIL PROTECTED]>
> Subject: Stupid Servlet Question
> To: [EMAIL PROTECTED]
>
> I am having some problems with servlets.
> I have a Login.html which hits the LoginServlet. Within the doPost method I am
trying to extract the parameters from the httpResult, but they are all null.
>
> The Login.html is
> <HTML>
> <HEAD>
> <TITLE>Login Test</TITLE>
> <BODY>
> <H3><CENTER>Login</CENTER></H3>
> <FORM NAME = "Test" ENCTYPE="text/plain" ACTION =
"http://simon_peter:7001/login" METHOD="GET">
> <PRE>
>
> UserName: <INPUT TYPE = TEXT name = "Username"><P>
> Password: <INPUT TYPE = PASSWORD name = "Password"><BR><BR>
> </PRE>
> <BR>
> <INPUT TYPE = SUBMIT VALUE = "Done with Login">
> <BR>
> </FORM>
> </BODY>
> </HTML>
>
> And the LoginServlet.
> public void doPost (HttpServletRequest httpRequest, HttpServletResponse
httpResponse)
> throws ServletException, IOException
> {
> HttpSession session = httpRequest.getSession(true);
>
> String stUserName = httpRequest.getParameter("Username");
> String stPassword = httpRequest.getParameter("Password");
> Login login = null;
>
> httpResponse.setContentType("text/html");
> PrintWriter out = httpResponse.getWriter();
> out.println("DoingPost:\r\n");
> out.println("Username was :" +stUserName +"\r\n");
> out.println("Password was :" +stPassword +"\r\n");
> blah blah blah....
> out.close();
> ---------------------------------------
> the result is spitting out.
> DoingPost: UserName was : nullPassword was :null
>
> Can anyone shead some light. thanks
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html