Reputation: 119
I am forwarding my request from Login servlet to a FacultyHomePage.jsp located in faculty folder(which is subfolder)....The page is displayed but url remains /LoginServlet. Why isn't the url changing??
HttpSession sc= request.getSession();
if(usertype==0)
{
sc.setAttribute("type", usertype);
sc.setAttribute("id",id );
rd=request.getRequestDispatcher("/faculty/FacultyHomePage.jsp");
rd.forward(request, response);
}
Upvotes: 1
Views: 4160
Reputation: 9168
New request
object will not be created in request dispatcher. Check RequestDispatcher.forward method.
If you want a URL change then use response.sendRedirect(java.lang.String)
Upvotes: 5