Servlet not working
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anupama_G
Posted On:   Thursday, April 19, 2001 10:03 PM

" + "Valid User" +" Hi friends This is my servlet and it is not working..what's wrong?? Can anybody help me?? import javax.servlet.*; import javax.servlet.http.*; import java.io.*; public class LoginServlet extends HttpServlet{ public void doPost(HttpServletRequest req,HttpServletResponse res) throws IOException, ServletException{ String userid=req.getParameter("userid"); String password=req.getParameter("password"); res.setContentType("text/html"); ServletOutputStream out = res.getOutputStream(); try { if((userid.equals(   More>>
" + "Valid User" +"

Hi friends
This is my servlet and it is not working..what's wrong??
Can anybody help me??













import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class LoginServlet extends HttpServlet{
public void doPost(HttpServletRequest req,HttpServletResponse res)
throws IOException, ServletException{
String userid=req.getParameter("userid");
String password=req.getParameter("password");
res.setContentType("text/html");
ServletOutputStream out = res.getOutputStream();

try {

if((userid.equals("user")&&password.equals("user")))
{
out.println(" ");
out.println(" ");
/*out.println(" ""


="http://ntserver2/webapp/examples/home.html">");
out.println(" ");

out.println(" ");*/
out.println(" ");
out.println(" ");

}
else {

out.println(" ");
out.println(" " + "InValid User" +" ");
/*out.println(" " "

="http://ntserver2/prototype/login.html">");
out.println(" ");*/
out.println(" ");
out.println(" ");


}
}

catch (Exception ex) {
System.err.println(" Caught an unexpected exception!");
ex.printStackTrace();
}
}
}
   <<Less

Re: Servlet not working

Posted By:   Michael_Wax  
Posted On:   Friday, April 20, 2001 05:19 PM

When you say it is not working, are you getting an exception, and, if so, what is it? Also, please format your question before submitting it so that we can read it.
About | Sitemap | Contact