That's exactly what's happening, but it's also warning (in devmode only)
when it can't set one so that you, the developer, can make the right
decision for your program.
  (*Chris*)

On Tue, Jul 26, 2011 at 6:50 AM, Paul Benedict <pbened...@apache.org> wrote:

> Just a question, if I may :-) Doesn't Struts 2 have the ability to
> only set the properties that are defined on the bean?
>
> On Tue, Jul 26, 2011 at 8:46 AM, Maurizio Cucchiara
> <maurizio.cucchi...@gmail.com> wrote:
> > There are different schools of thought, this is kind of question that has
> > multiple answers: please, take a look at
> >
> http://struts.1045723.n5.nabble.com/S2-OgnlValueStack-Error-setting-expression-warnings-after-upgrade-from-struts-2-to-struts-2-1-7-td3495667.html
> >
> > On 26 July 2011 14:58, Christian Grobmeier <grobme...@gmail.com> wrote:
> >
> >> > @Christian
> >> > Good workaround,
> >> > in my defence I can say that I have no problem to change the log
> level,
> >> > thank to maven I can have different profile with different log level.
> >>
> >> hehe yes I have a similar setup I guess. But "expected exceptions"
> >> make me always nervous, even in development mode ,-)
> >>
> >> >
> >> > Maurizio Cucchiara
> >> >
> >> > Il giorno 26/lug/2011 12.26, "Christian Grobmeier" <
> grobme...@gmail.com>
> >> ha
> >> > scritto:
> >> >> Thanks Maurizio.
> >> >>
> >> >> I don't want to reduce my error level, now I created something weird.
> >> >> Not nice, but it works:
> >> >>
> >> >> private Submit submitCoord = null;
> >> >>
> >> >> public Submit getSubmit() {
> >> >> return submitCoord;
> >> >> }
> >> >>
> >> >> public void setSubmit(String submit) {
> >> >> this.submitCoord = new Submit(submit);
> >> >> }
> >> >>
> >> >> class Submit {
> >> >> private int x = 0;
> >> >> private int y = 0;
> >> >> private String name = "";
> >> >>
> >> >> private Submit(String name) {
> >> >> super();
> >> >> this.name = name;
> >> >> }
> >> >>
> >> >> public String getName() {
> >> >> return name;
> >> >> }
> >> >>
> >> >> public int getX() {
> >> >> return x;
> >> >> }
> >> >> public void setX(int x) {
> >> >> this.x = x;
> >> >> }
> >> >> public int getY() {
> >> >> return y;
> >> >> }
> >> >> public void setY(int y) {
> >> >> this.y = y;
> >> >> }
> >> >>
> >> >> }
> >> >>
> >> >> Cheers
> >> >> Christian
> >> >>
> >> >> On Tue, Jul 26, 2011 at 11:49 AM, Maurizio Cucchiara
> >> >> <maurizio.cucchi...@gmail.com> wrote:
> >> >>> Hi Christian,
> >> >>> unfortunately IIRC there is no way to avoid that OGNL tries to find
> the
> >> >>> property accessor.
> >> >>>
> >> >>> Adding this row in your log4j.xml (properties) should mute this log
> >> > message
> >> >>> (which it should not be a warning message)
> >> >>>
> >> >>>    <category name="com.opensymphony.xwork2.ognl.OgnlValueStack">
> >> >>>        <priority value="error"/>
> >> >>>    </category>
> >> >>>
> >> >>>
> >> >>> On 26 July 2011 11:27, Christian Grobmeier <grobme...@gmail.com>
> >> wrote:
> >> >>>
> >> >>>> Hi,
> >> >>>>
> >> >>>> using:
> >> >>>> <s:submit type="image" src="images/icons/app/32x32/sign-in.png"
> >> >>>> name="submit" />
> >> >>>>
> >> >>>> Sends the following to my action:
> >> >>>> submit => [ Submit ] submit.x => [ 40 ] submit.y => [ 7 ]
> >> >>>>
> >> >>>> x / y are coordinates of my click, defined by w3c. Now they are
> sent
> >> >>>> to my action, and OGNL tries to set it. Which leads to:
> >> >>>>
> >> >>>> > Error setting expression 'submit.x' with value
> >> >>>> '[Ljava.lang.String;@a53ed8f'
> >> >>>> > ognl.NoSuchPropertyException: java.lang.String.x
> >> >>>>
> >> >>>> Of course, ognl, sets a string "submit", then tries to find the
> getX
> >> >>>> method on my string which does not exist.
> >> >>>>
> >> >>>> How can I deal with that?
> >> >>>>
> >> >>>> Cheers
> >> >>>> Christian
> >> >>>>
> >> >>>>
> ---------------------------------------------------------------------
> >> >>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> >>>> For additional commands, e-mail: user-h...@struts.apache.org
> >> >>>>
> >> >>>>
> >> >>>
> >> >>>
> >> >>> --
> >> >>> Maurizio Cucchiara
> >> >>>
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> http://www.grobmeier.de
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> >> For additional commands, e-mail: user-h...@struts.apache.org
> >> >>
> >> >
> >>
> >>
> >>
> >> --
> >> http://www.grobmeier.de
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >>
> >
> >
> > --
> > Maurizio Cucchiara
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

Reply via email to