struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Thompson <elephant...@gmail.com>
Subject Re: Struts2 Validation with Spring convention plugin
Date Tue, 26 Jan 2010 15:40:50 GMT
You might look into using the Preparable interface [1].  It's useful for
these types of situations; just add the code to generate the list into a
prepare() method on your action class instead of in execute().

Hope this helps,

-Brian

[1] -
http://www.opensymphony.com/xwork/api/com/opensymphony/xwork2/Preparable.html



On Tue, Jan 26, 2010 at 7:22 AM, nani2ratna <nani2ratna@gmail.com> wrote:

>
> Hi,
>
> I am using struts2, spring with spring convention plugin.
> SO all my action classes has been specified in application-Context.xml.
> One of my action class got Bean as a property. So I can dealt with the bean
> properties in JSP.
>
> The problem, when I am working with my validation i am getting Error
> messages repeated problem.
> Solution for this one is change scope to prototype.
>
> Now I got another problem, I got a list box in jsp page. If validation
> fails
> I am getting the following error.
> could not be resolved as a collection/array/map/enumeration/iterator type
>
> This is happening because, list in Javabean becoming null when validation
> fails.
>
> Then i changed scope="request". And i have added cglib.jar.
> Now i am getting following error.
>
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean
> with name 'scopedTarget.pmaction': Scope 'request' is not active for the
> current thread; consider defining a scoped proxy for this bean if you
> intend
> to refer to it from a singleton; nested exception is
> java.lang.IllegalStateException: No thread-bound request found: Are you
> referring to request attributes outside of an actual web request, or
> processing a request outside of the originally receiving thread? If you are
> actually operating within a web request and still receive this message,
> your
> code is probably running outside of DispatcherServlet/DispatcherPortlet: In
> this case, use RequestContextListener or RequestContextFilter to expose the
> current request.
>
>
> So if you have list box in jsp page and need to do validation on that jsp
> page. ANd you configured all your action classes in Spring appContext file.
> You wont succeed.
>
> Is that correct. Or is there any solution.
>
> Thanks and Regards
> RS
> --
> View this message in context:
> http://old.nabble.com/Struts2-Validation-with-Spring-convention-plugin-tp27322517p27322517.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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