I need to forward to another JSP page based on so-called "action" parameters.
I have the following piece of code from servlet
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String action=request.getParameter("action");
if(action=="login"){
RequestDispatcher requestDispatcher = getServletContext().getRequestDispatcher("/login.jsp");
requestDispatcher.forward(request, response);
};
}
I have a JSP page "login.jsp". When I type the following url
http://localhost:8080/AgileScrumBoard/MainController?action=login
the browser doesn't forward me to the login.jsp page. What might be an issue?