Submit image button sends coordinates

2011-07-26 Thread Christian Grobmeier
Hi, using: 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.Stri

Re: Submit image button sends coordinates

2011-07-26 Thread Maurizio Cucchiara
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) On 26 July 2011 11:27, Christian Grobmeier wrote:

Re: Submit image button sends coordinates

2011-07-26 Thread Christian Grobmeier
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) {

Re: Submit image button sends coordinates

2011-07-26 Thread Aaron Brown
You may be able to write an interceptor that strips X and Y from your cgi parameters. You would need to set the interceptor prior to the default interceptor that assigns params to your action set methods. On Jul 26, 2011 5:50 AM, "Maurizio Cucchiara" wrote: > Hi Christian, > unfortunately IIRC th

Re: Submit image button sends coordinates

2011-07-26 Thread Maurizio Cucchiara
@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. Maurizio Cucchiara Il giorno 26/lug/2011 12.26, "Christian Grobmeier" ha scritto: > Thanks Maurizio. > > I don't want to reduc

Re: Submit image button sends coordinates

2011-07-26 Thread Maurizio Cucchiara
Aaron's advice suggested me another way to obtain what you are looking for: you could simple blacklist x & y parameters through the parameters interceptor. Maurizio Cucchiara Il giorno 26/lug/2011 12.30, "Aaron Brown" ha scritto: > You may be able to write an interceptor that strips X and Y from

Re: Submit image button sends coordinates

2011-07-26 Thread Christian Grobmeier
> @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 ,-)

Re: Submit image button sends coordinates

2011-07-26 Thread Maurizio Cucchiara
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 Gro

Re: Submit image button sends coordinates

2011-07-26 Thread Paul Benedict
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 wrote: > There are different schools of thought, this is kind of question that has > multiple answers: please, take a look a

Re: Submit image button sends coordinates

2011-07-26 Thread Chris Pratt
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 wrote: > Just a question, if I may :-) Doesn't Struts 2 have the abi

Re: Submit image button sends coordinates

2011-07-26 Thread Paul Benedict
I don't understand that. Perhaps I haven't programmed Struts 2 enough, but I thought Struts (1 or 2) only captured what's defined in the model and ignores the other request parameters. Is it acting differently because of nested properties? On Tue, Jul 26, 2011 at 9:54 AM, Chris Pratt wrote: > Tha

Re: Submit image button sends coordinates

2011-07-26 Thread Christian Grobmeier
I see, I am one of those who always want to see whats going on Interesting read. Might be worth to compile a wiki entry? On Tue, Jul 26, 2011 at 3:46 PM, Maurizio Cucchiara wrote: > There are different schools of thought, this is kind of question that has > multiple answers: please, take a look

Re: Submit image button sends coordinates

2011-07-26 Thread Chris Pratt
I think you're thinking about it backwards. It doesn't start with the bean, inspect every property, attempt to find data and convert that data to the proper format, then inject it into the bean. It starts with the data on hand (in this case all the GET/POST parameters) and attempts to find a home

Re: Submit image button sends coordinates

2011-07-26 Thread Maurizio Cucchiara
Hi Paul, you hit the nail on the head: if you try to get http://localhost:8080/struts.action?whatever=whaever_value you won't see any exception (in no-dev mode). On the contrary, when you use a nested property, ognl change the target object. For example if you use a "a" property, Ognl uses as a tar

Re: Submit image button sends coordinates

2011-07-26 Thread Maurizio Cucchiara
> > I think you're thinking about it backwards. It doesn't start with the > bean, inspect every property, attempt to find data and convert that data to > the proper format, then inject it into the bean. Chris is right: take a look at row 292 of [1] [1] http://svn.apache.org/viewvc/struts/struts2

Re: Submit image button sends coordinates

2011-07-26 Thread Maurizio Cucchiara
@Christian I don't know if it does or not, IMHO there is something that is not proper consistent between the nested property and the plain property (looking at the code, I realize that theoretically only when the user runs s2 in dev mode, this kind of exception should be throwned). My guess is tha