struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Greene <da...@securelink.com>
Subject Re: Upgrading spring 3.0.7 to spring 3.2.3 caused "INPUT" instead of "SUCCESS" result
Date Sat, 24 Aug 2013 14:45:44 GMT
Yea, it's certainly not the appropriate solution, but alas - I believe it's
the only workaround unless you want to go edit the struts-spring plugin
code....


On Sat, Aug 24, 2013 at 9:09 AM, Dionis Argiri <dionis.argiri@gmail.com>wrote:

> Good point David. Thanks.
>
> But it seems again like a workaround.
>
> P.S. I hope, that someone will find a better solution :)
>
>
> 2013/8/24 David Greene <david@securelink.com>
>
> > I had the same issue, here's my thread from a while back:
> >
> > http://comments.gmane.org/gmane.comp.jakarta.struts.user/184485
> >
> > If I recall correctly, spring is injecting some random Map on its context
> > into the error map which is causing some random non-error to be
> considered
> > an error.
> >
> > It has to do with autowire by name vs. by type.  Long story short, switch
> > to by name and it'll fix it magically.  I don't particularly like it, but
> > meh... it fixed the issue and I moved on.
> >
> >
> > On Sat, Aug 24, 2013 at 6:06 AM, Dionis Argiri <dionis.argiri@gmail.com
> > >wrote:
> >
> > > Hi.
> > >
> > > I'm using struts 2 & struts-spring plugin.
> > > Both are of version 2.3.15.1.
> > >
> > > The problem is that after upgrading spring from 3.0.7 to spring 3.2.3 I
> > > started to get "INPUT" instead of "SUCCESS" result.
> > > After debugging for some time I've figured out, that method
> > > "setFieldErrors(Map<String, List<String>> errorMap)" is called
(All my
> > > actions are extending ActionSupport class).
> > >
> > > Following argument is passed to method:
> > >
> > >
> > >    - errorMap = {java.util.LinkedHashMap@8375} size = 1
> > >    - [0] = {java.util.LinkedHashMap$Entry@8385
> > >
> >
> }"org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry"
> > >    -> size = 0
> > >    - key: java.lang.String =
> > > {java.lang.String@8386
> > >
> >
> }"org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry"
> > >
> > >    - value:
> > >
> > >
> >
>  org.springframework.context.annotation.ConfigurationClassParser$ImportStack
> > >    =
> > >
> > >
> >
>  {org.springframework.context.annotation.ConfigurationClassParser$ImportStack@8387
> > > }
> > >    size = 0
> > >
> > > Don't know why this is happening.
> > >
> > > Configurations related to spring plugin:
> > >
> > > <constant name="struts.objectFactory.spring.autoWire" value="auto"/>
> > >
> > > Same happends when I'm changing it to:
> > >
> > > <constant name="struts.objectFactory.spring.autoWire" value="type"/>
> > >
> > > Property that got injected wrongly is "fieldErrors" (captain obvious ;)
> > ).
> > >
> > > Any ideas guys?
> > > P.S. Currently I added ugly hack that's workarounding my issue:
> > > @Override
> > >     public void setFieldErrors(Map<String, List<String>> errorMap)
{
> > >
> > >
> > >
> >
> if(errorMap.containsKey("org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry")){
> > >
> > >
> > >
> >
> errorMap.remove("org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry");
> > >         }
> > >
> > >         super.setFieldErrors(errorMap);
> > >     }
> > >
> >
> >
> >
> > --
> > ----------------------------------------------------------
> > *David Greene*
> > *SecureLink, Inc.*
> > Secure networks for remote support
> > ----------------------------------------------------------
> > (512) 630-2285 (m)
> > (512) 637-8744 (o)
> > ----------------------------------------------------------
> > david@securelink.com
> >
>



-- 
----------------------------------------------------------
*David Greene*
*SecureLink, Inc.*
Secure networks for remote support
----------------------------------------------------------
(512) 630-2285 (m)
(512) 637-8744 (o)
----------------------------------------------------------
david@securelink.com

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