struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Lee" <crazy...@crazybob.org>
Subject Re: XWork and OGNL question
Date Mon, 02 Apr 2007 18:44:34 GMT
Are you using the Guice Struts 2 plugin? I didn't realize Struts 2 would
delegate to the ObjectFactory to create an int[].

Bob

On 4/2/07, Brian Pontarelli <brian@pontarelli.com> wrote:
>
>
> I'm playing around with Guice as an ObjectFactory and I've run into an
> issue. I've got an action that I want to handle an array of values from
> a form using the [] notation. My form looks something like:
>
> <input type="text" name="numbers[0]"/>
> <input type="text" name="numbers[1]"/>
> ...
>
> My action is roughly:
>
> public class Update extends ActionSupport {
>   private int[] numbers;
>   // getter and setter
> }
>
> What I've found is that when the ParametersInterceptor is called it
> delegates to Ognl and rather than Ognl creating the array and doing all
> the type conversions it is passing control over to Guice and asking
> Guice to instantiate an instance of int[], which of course fails. Is
> this correct or am I missing something between Ognl, XWork and Guice? Or
> is Guice not playing nice and handing back control to Ognl or XWork like
> it is supposed to?
>
> Thanks,
> -bp
>
>
> ---------------------------------------------------------------------
> 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