You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Scott Van Wart <sc...@indosoft.com> on 2006/08/25 04:04:57 UTC

[1.3] Session ActionMessages won't go away

Hi, I have something very close to the following in each of my pages 
(actually, just in the layout page for tiles, but whatever).  Worked 
fine in Struts 1.2.9 (even though I'm not so sure it's the best way to 
print messages and errors, but oh well...)

    <logic:messagesPresent message="true">
        <bean:message key="header.notice" />
        <ul>
            <html:messages id="message" message="true">
                <li><bean:write name="message" /></li>
            </html:messages>
        </ul>
    </logic:messagesPresent>
        
    <logic:messagesPresent message="false">
        <bean:message key="header.error" />
        <ul>
            <html:messages id="error" message="false">
                <li><bean:write name="error" /></li>
            </html:messages>
        </ul>
    </logic:messagesPresent>

I store my messages in the session so they'll persist even after a 
redirect.  Unfortunately, in 1.3, when I call saveMessages( 
request.getSession(), messages ), the message appears properly, but 
continues to appear on subsequent page requests.  Any ideas?

- Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [1.3] Session ActionMessages won't go away

Posted by Niall Pemberton <ni...@gmail.com>.
On 8/25/06, Scott Van Wart <sc...@indosoft.com> wrote:
> Niall Pemberton wrote:
> > Dam, looks like I missed updating the tiles version of the
> > chain-config.xml - the version in struts-core-1.3.5.jar has that
> > command. Could you file a JIRA issue for this please:
> >
> > https://issues.apache.org/struts/browse/STR
> Okie,
>
> https://issues.apache.org/struts/browse/STR-2935

Thanks, now fixed in svn trunk - also found the SetOriginalURI
command was missing from the tiles version:

http://svn.apache.org/viewvc?view=rev&revision=436861

Niall

> - Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [1.3] Session ActionMessages won't go away

Posted by Scott Van Wart <sc...@indosoft.com>.
Niall Pemberton wrote:
> Dam, looks like I missed updating the tiles version of the
> chain-config.xml - the version in struts-core-1.3.5.jar has that
> command. Could you file a JIRA issue for this please:
>
> https://issues.apache.org/struts/browse/STR
Okie,

https://issues.apache.org/struts/browse/STR-2935

- Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [1.3] Session ActionMessages won't go away

Posted by Niall Pemberton <ni...@gmail.com>.
On 8/25/06, Scott Van Wart <sc...@indosoft.com> wrote:
> Niall Pemberton wrote:
> > The functionality to automtaically remove messages cached in the
> > session was missing from Struts 1.3.x and only added recently in the
> > Struts 1.3.5 version:
> >
> >    http://issues.apache.org/struts/browse/STR-2883
> >    http://svn.apache.org/viewvc?view=rev&revision=412834
> >
> > Are you using Struts 1.3.5?
> >
> > Also how are you configuring the ComposableRequestProcessor commands?
> > Are you letting it pick up the default chain-config.xml shipped in the
> > jar or do you have a custom (or tiles) one that you're specifying
> > through the web.xml?
> >
> > If you have a custom one, does it include the new RemoveCachedMessages
> > command?
> I have a custom one.  Here's what I did:
>
> Added the following to web.xml:
>
>     <init-param>
>         <param-name>chainConfig</param-name>
>         <param-value>/WEB-INF/chain-config.xml</param-value>
>     </init-param>
>
> Copied the chain-config.xml from struts-tiles-1.3.5.jar and stuck it in

Dam, looks like I missed updating the tiles version of the
chain-config.xml - the version in struts-core-1.3.5.jar has that
command. Could you file a JIRA issue for this please:

https://issues.apache.org/struts/browse/STR

> /WEB-INF/chain-config.xml.  I don't see the RemoveCachedMessages command
> in the config; I'll grab it from the links you mentioned above.  Is this
> the correct way to customize chain-config.xml?

Yes looks OK

http://struts.apache.org/1.x/userGuide/configuration.html#dd_config_servlet

Niall

> - Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [1.3] Session ActionMessages won't go away

Posted by Scott Van Wart <sc...@indosoft.com>.
Niall Pemberton wrote:
> The functionality to automtaically remove messages cached in the
> session was missing from Struts 1.3.x and only added recently in the
> Struts 1.3.5 version:
>
>    http://issues.apache.org/struts/browse/STR-2883
>    http://svn.apache.org/viewvc?view=rev&revision=412834
>
> Are you using Struts 1.3.5?
>
> Also how are you configuring the ComposableRequestProcessor commands?
> Are you letting it pick up the default chain-config.xml shipped in the
> jar or do you have a custom (or tiles) one that you're specifying
> through the web.xml?
>
> If you have a custom one, does it include the new RemoveCachedMessages 
> command?
I have a custom one.  Here's what I did:

Added the following to web.xml:

    <init-param>
        <param-name>chainConfig</param-name>
        <param-value>/WEB-INF/chain-config.xml</param-value>
    </init-param>

Copied the chain-config.xml from struts-tiles-1.3.5.jar and stuck it in 
/WEB-INF/chain-config.xml.  I don't see the RemoveCachedMessages command 
in the config; I'll grab it from the links you mentioned above.  Is this 
the correct way to customize chain-config.xml?

- Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [1.3] Session ActionMessages won't go away

Posted by Niall Pemberton <ni...@gmail.com>.
The functionality to automtaically remove messages cached in the
session was missing from Struts 1.3.x and only added recently in the
Struts 1.3.5 version:

    http://issues.apache.org/struts/browse/STR-2883
    http://svn.apache.org/viewvc?view=rev&revision=412834

Are you using Struts 1.3.5?

Also how are you configuring the ComposableRequestProcessor commands?
Are you letting it pick up the default chain-config.xml shipped in the
jar or do you have a custom (or tiles) one that you're specifying
through the web.xml?

If you have a custom one, does it include the new RemoveCachedMessages command?

Niall

On 8/25/06, Scott Van Wart <sc...@indosoft.com> wrote:
> Hi, I have something very close to the following in each of my pages
> (actually, just in the layout page for tiles, but whatever).  Worked
> fine in Struts 1.2.9 (even though I'm not so sure it's the best way to
> print messages and errors, but oh well...)
>
>     <logic:messagesPresent message="true">
>         <bean:message key="header.notice" />
>         <ul>
>             <html:messages id="message" message="true">
>                 <li><bean:write name="message" /></li>
>             </html:messages>
>         </ul>
>     </logic:messagesPresent>
>
>     <logic:messagesPresent message="false">
>         <bean:message key="header.error" />
>         <ul>
>             <html:messages id="error" message="false">
>                 <li><bean:write name="error" /></li>
>             </html:messages>
>         </ul>
>     </logic:messagesPresent>
>
> I store my messages in the session so they'll persist even after a
> redirect.  Unfortunately, in 1.3, when I call saveMessages(
> request.getSession(), messages ), the message appears properly, but
> continues to appear on subsequent page requests.  Any ideas?
>
> - Scott
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org