struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Huber <gregh3...@gmail.com>
Subject Re: [VOTE] Struts 2.3.27
Date Fri, 18 Mar 2016 15:38:40 GMT
The reason why its not working it needs to know whether it is an
instanceof ServletRedirectResult in MessageStorePreResultListener.

Rather than use the result (which do do not have) a possible solution is to
construct what its looking for from the invocation and the use an equals.


Map<String, ResultConfig> results =
((DefaultActionInvocation)invocation).getProxy().getConfig().getResults();

        ResultConfig resultConfig = null;

        try {
            resultConfig = results.get(resultCode);
        } catch (NullPointerException e) {
            LOG.debug("Got NPE trying to read result configuration for
resultCode [{}]", resultCode);
        }

        boolean isRedirect = false;
        try {
            //isRedirect = invocation.getResult() instanceof
ServletRedirectResult;
            isRedirect =
"org.apache.struts2.result.ServletRedirectResult".equals(resultConfig.getClassName());
        } catch (Exception e) {
            LOG.warn("Cannot read result!", e);
        }









On 18 March 2016 at 14:04, Lukasz Lenart <lukaszlenart@apache.org> wrote:

> I see no other way just revert that change and change that was
> introduced to fix the original issue
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> 2016-03-18 14:26 GMT+01:00 Greg Huber <gregh3269@gmail.com>:
> > Sorry forget the last email, its rubbish.  Won't work. Thought the code
> was
> > part of the mod, which it is not.
> >
> > On 18 March 2016 at 11:45, Lukasz Lenart <lukaszlenart@apache.org>
> wrote:
> >
> >> 2016-03-18 12:29 GMT+01:00 Greg Huber <gregh3269@gmail.com>:
> >> > I have tested it without the change (to DefaultActionInvocation) and
> the
> >> > messages work on the redirects. Unless it is confirmed that it is
> >> required
> >> > ie it does not work in its original position, its best not to change
> >> such a
> >> > key program.  In my opinion.
> >>
> >> How do you use MessageStoreInterceptor with redirects? In AUTOMATIC or
> >> STORE mode?
> >> This change is needed to allow AUTOMATIC mode to work with redirects
> >>
> >>
> >>
> https://github.com/apache/struts/blob/master/core/src/main/java/org/apache/struts2/interceptor/MessageStorePreResultListener.java#L72
> >>
> >>
> >> Regards
> >> --
> >> Łukasz
> >> + 48 606 323 122 http://www.lenart.org.pl/
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: dev-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message