AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

struts session problem

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
Lam
Guest





PostPosted: Fri Jul 15, 2005 5:11 pm    Post subject: struts session problem Reply with quote




hi
i have a problem with struts and session managment
i create a webapps with an identification page (login/password)
i create a session after this identification

web.xml defines session like this :

<!-- Session Timeout Information in Minutes -->
<session-config>
<session-timeout>15</session-timeout>
</session-config>


i an Action object :

public final ActionForward execute(ActionMapping mapping, ActionForm
form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

log.info("EditUserAction");

ActionErrors errors = new ActionErrors();

EditUserForm userForm = (EditUserForm) form;

String token = "";
if (errors.isEmpty()) {

HttpSession session = request.getSession(false);
if (session == null) {
log.info("no session");
errors.add("login",
new
ActionMessage("errors.login.required"));
token = FAIL_MAPPING;

} else {
log.info("Session " + session.toString());

...
}

log.info("EditUserAction done");
return mapping.findForward(token);
}


so, i start my webapps, i put my login/password, and after this i have
a cookie with my session
i delete this cookie, and i do the editUser.do
i think after this i would see in log "No session..." but i have this :

INFO: Session org.apache.tomcat.facade.HttpSessionFacade@cb2185

why i have a session ??
could you help me ?

struts-config.xml is defined like this :

<form-bean name="EditUserForm"
type="org.myproject.struts.form.EditUserForm">
</form-bean>

and

<action path="/editUser"
type="org.myproject.struts.actions.EditUserAction"
name="EditUserForm"
scope="request"
input="/utilisateur.jsp">
<forward name="success" path="/utilisateur.jsp" redirect="false"/>
<forward name="fail" path="/main.jsp" redirect="false"/>
</action>


any idea ?


thanks for any help



--
Lam

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.