Hi,
I'm trying to make simple login/logout function in my application. This
application is using Struts1 framework. The problem is that my solution
works perfectly on localhost, but not in google app engine. Here is
what I have in brief:
The information about being sign in or not is stored in my java bean
class called UserBean. UserBean has some properties, like email...


Now, because I use struts, I have created my LoginAction class (extends
org.apache.struts.action.Action), where is method execute. In this
method I check values from form with database and if it is all correct,
I create new UserBean instance and put it into a session (like
request.getSession().setAttribute("us", userBeanInstance); After this
user is redirected to some index.jsp page, where is this logout form:


<c:when test="${us.email != null}"> // if true, user is signed in


<html:form action="logout.do" >
<html:submit value="Sign out ${us.name}"/>
</html:form>
</c:when>...


And it works ok, there is a button with user's name. But I have another
form in this page for posting messages. And when I try to post some
messages (while I'm logged in), another Action class process this
request. In this Action class, I'm trying to get information about user
from the instance of UserBean, like this:
UserBean u = (UserBean) request.getSession().getAttribute("us");



But there is the problem, it is null on google app engine and it is
just fine on localhost... And I can't find why is making problems :(


In each jsp page I have following declarations:
<%@ page session="true"%>
<jsp:useBean class="cz.sayit.beans.UserBean" scope="session" id="us" />



In appengine-web.xml I have:
<sessions-enabled>true</sessions-enabled>



And in config file for struts (struts-config.xml), I have always scope
set to session value, like this:
<action path="/login" name="LoginForm"
type="cz.sayit.actions.LoginAction" scope="session" validate="true"
input="/index.jsp">



Does anyone have any idea what is wrong? Thank for any advice

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to