Hey,
Quick question, i have 2 jsp pages, Welcome.jsp, and ProcessLogin.jsp.
Welcome.jsp displays the text boxes for the login form once the submit button is hit i call ProcessLogin.jsp and set the username and password values in LoginUser.java via this ProcessLogin.jsp.
Using the following code in ProcessLogin.jsp i instanciate LoginUser.java with a scope of "session"
Code:
<%@ page import="java.util.*" %>
<%!
ResourceBundle bundle =null;
public void jspInit() {
bundle = ResourceBundle.getBundle("login");
}
%>
<%@ page session="true"%>
<jsp:useBean id="user_login" class="user_login.login_user" scope="session">
<jsp:setProperty name="user_login" property="*"/>
</jsp:useBean>
<%
if (user_login.validateUserLogin()) {
%>
<jsp:forward page="<%=bundle.getString(\"login.successfullLogin\")%>"/>
<%
} else {
%>
<jsp:forward page="<%=bundle.getString(\"login.unsuccessfullLogin\")%>"/>
<%
}
%
Now this process is working fine for me, however i want to change the login.successfullLogin page so it directs the user back to the Welcome.jsp page, there is a little bit of logic on the welcome page that checks if the user is logged in, and this is where my problem lies. The user information/status is kept in the LoginUser.java object.
If this has been instanciated in the ProcessLogin.jsp how do i access this object from the welcome.jsp page?
I may not be explaining this as well as possible, so let me know if you need anything else.
Thanks
Rob