Simple if statement with checking user selection will solve the problem
if(student)
{
RequestDispatcher dispatcher = getServletContex().getRequestDispatcher("/student.jsp");
dispatcher.forward(request, response);
}
else if(teacher)
{
RequestDispatcher dispatcher = getServletContex().getRequestDispatcher("/teacher.jsp");
dispatcher.forward(request, response);
}
else
{
RequestDispatcher dispatcher = getServletContex().getRequestDispatcher("/admin.jsp");
dispatcher.forward(request, response);
}
PS: Please use hash sign "#" to insert any code into your post. It will keep code format as from IDE and post would not be so long. Thanx
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
Which you tried and which code is not working?
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
1. learn how to start a new thread
2. learn about sessions and storing information in them
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433