Error in the login.java, please any one can check it and tell me the error

Here i posted my program:

import java.io.*;

import java.util.*;

import javax.servlet.*;

import javax.servlet.http.*;

public class login extends HttpServlet

{

public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException

{

String username = req.getParameter("user");

String password = req.getParameter("pwd");

//req.setAttribute("message", "Hello, world");

ServletContext app = getServletContext();

if(username.equals("sathya") && password.equals("test"))

{

RequestDispatcher disp;

disp = app.getRequestDispatcher("sample.jsp");

disp.forward(req, res);

}

else

{

RequestDispatcher disp;

disp = app.getRequestDispatcher("failure.jsp");

disp.forward(req, res);

}

}

}

[880 byte] By [deepu123a] at [2007-11-27 6:47:48]
# 1
plz us the cd frmttng tgstx
RajeshPunthabira at 2007-7-12 18:20:51 > top of Java-index,Java Essentials,Java Programming...
# 2

> plz us the cd frmttng tgs

>

> tx

Agreed; use code tags. And no SMS speak :D

> Error in the login.java, please any one can check it and tell me the error

How about you tell us the error and we see if we can figure out what the problem is? So, what is the error/ exception/ problem you're facing, exactly?

nogoodatcodinga at 2007-7-12 18:20:51 > top of Java-index,Java Essentials,Java Programming...
# 3
when i am compiling my program its giving error like it could not fine the request dispatcher
deepu123a at 2007-7-12 18:20:51 > top of Java-index,Java Essentials,Java Programming...
# 4

When you're posting about errors, don't give vague remarks like 'its giving error like'; post the exact stack trace.

Make some effort to trace your errors on your own and locate the line number where the exception occurs and then maybe some else will make an effort to help you out.

In this case, your path for the JSPs is probaly wrong. Try using "../failure.jsp" and similarly for the other one.

nogoodatcodinga at 2007-7-12 18:20:51 > top of Java-index,Java Essentials,Java Programming...