struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daveck <>
Subject Losing Session Attributes
Date Tue, 05 Feb 2008 20:24:17 GMT

I'm looking for some help, or some input on why I might be losing session
attributes (Not the session itself).

Processing Flow:
quest.action --> quest-input.jsp  -> quest.action --> MyInterceptor -> 
                      confirm.jsp -> question.action --> quest-success.jsp

I am setting session attributes in my interceptor to have available
following the confirm.jsp.

Sometimes the attributes are there and sometimes they're not.  There doesn't
seem to be any rhyme or reason.

Probably something simple I'm overlooking, but if so, I've been overlooking
it for two days!


    public String intercept (ActionInvocation invocation) throws Exception {

        final ActionContext context = invocation.getInvocationContext();
	    HttpServletRequest request = (HttpServletRequest)
	    HttpSession session =  request.getSession(true);

        // check if request is coming form the Confirmation Screen
        if ((request.getParameter("CONFIRM_SCREEN") != null) &&
                (request.getParameter("CONFIRM_SCREEN").equals("TRUE"))) {

            String urlGoingTo = invocation.getProxy().getNamespace() +

            // save input form attributes to session
            session.setAttribute("PARMS", request.getParameterMap());

            // save the forwarding url for the Confirmation Screen
            session.setAttribute(URL_GOING_TO, urlGoingTo);

            return "confirm";
	    } else {
            return invocation.invoke();

    public String execute() throws Exception {

        if (this.getSession().containsKey("PARMS")) {
            BeanUtils.populate(this, (Map)this.getSession().get("PARMS"));

            return SUCCESS;

        } else {

            return INPUT;


    <%@ taglib prefix="s" uri="/struts-tags" %>
    <s:head theme="ajax" />
    <link href="<s:url value="/html/body.css"/>" rel="stylesheet"
type="text/css" />

    <s:div id="reg" label="Registration Number" theme="ajax"
            labelposition="top" >

     <s:form action="cowQuest" method="Post" validate="true">
                 list="nationList" />
         <s:textfield name="registrationNumber" label="Registration Number"
         <s:hidden name="CONFIRM_SCREEN" value="TRUE"/>
         <s:submit value="Click Here to Run" id="submit"/>


    <%@ taglib prefix="s" uri="/struts-tags"%>
    <link href="<s:url value="/html/body.css"/>" rel="stylesheet"
type="text/css" />

    <h2>Please confirm your request.</h2>
    <p>This could take several minutes depending on the request.</p>

    <s:form method="post">
        <s:param name="action" value="quest.action"/>
        <s:submit value="Confirm" align="center">
		    <s:param name="colspan" value="%{2}" />
		    <s:param name="align" value="%{'center'}" />


     <action name="quest" class="com.helpme.struts.actions.Quest">
         <interceptor-ref name="myInterceptor"/>
         <result name="input">/quest-input.jsp</result>
         <result name="confirm">/confirm.jsp</result>
         <result name="success">/quest-success.jsp</result>
         <result name="error">/quest-error.jsp</result>
View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message