I am trying to learn
JSF in WSAD 5.1.2. I have four faces JSPs: Login.jsp, AdminMainMenu.jsp, UserMainMenu.jsp and UserSearch.jsp. After starting WTE, I ran my Login.jsp which displayed the Login.jsp and gave me the URL of "http://localhost:9080/medsup/faces/Login.jsp". After typing the userid and clicking the submit button, it then went to "UserMainMenu.jsp" with the URL of "http://localhost:9080/medsup/faces/Login.jsp;jsessionid=0000YXtEAWkUp2LuBHHUdCfwX4Z:-1".
The following are the codes that I have in the Login.jsp"
[code]
public
String doButton1Action()
{
//actionBegin: goto.page
if (getUserId().getValue().equals("admin"))
gotoPage("/AdminMainMenu.jsp");
else
gotoPage("/UserMainMenu.jsp");
//actionEnd: goto.page
// Type
Java code to handle command event here
// Note, this code must return an object of type String (or
null)
return "";
}
[code]
When I pressed the submit button of the UserMainMenu.jsp, it did not go to UserSearch.jsp. Instead, it didn't go anywhere. It Just stayed there displaying UserMainMenu.jsp. When I traced it, I found out that when I pressed the submit button of the UserMainMenu.jsp, I executed the Login.jsp and not the UserMainMenu.jsp because the URL still has the Login.jsp.
Can somebody help me please? I need to know how I can alter the content of the URL in such a way that when I press the submit button of the Login.jsp and when it went to display the UserMainMenu.jsp, the URL also should have the UserMainMenu.jsp and not the Login.jsp. I already checked the option in WTE to enable the URL rewriting.