Hi Andrew,
I think that in login.html you have given the method as "Get".It
should have been "Post" so that u can retrieve the same in the doPost()
method.
Cheers
Bharath
> ----------
> From: Andrew Ahnn[SMTP:[EMAIL PROTECTED]]
> Reply To: A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology.
> Sent: Wednesday, February 16, 2000 1:56 AM
> To: [EMAIL PROTECTED]
> Subject: Stupid Servlet Question
>
> 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