import java.io.*;
import java.util.*;
public class MyServlet extends HttpServlet{
private String target="/hello.jsp";
public void init (ServletConfig config)throws ServletException
{super.init(config);}
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws ServleException ,IOException
{ doPost(request,response); }
public void doPost(HttpServletRequest request,HttpServletResponse response)
throws ServleException ,IOException{
String username =request.getParameter("username");
String password =request.getParameter("password");
request.setAttribute("USER",username);
request.setAttribute("PASSWORD",password);
ServletContext context=getServletContext();
System.out.println("Redirecting to"+target);
RequestDispatcher myservlet=context.getRequestDispatcher(target);
myservlet.forward(request,response);
}
public void destroy(){};
}