Re: paramsPrepareParamsStack and token interceptor

2014-08-21 Thread Fabian Richter

Done, see WW-4390

Am 20.08.2014 um 21:09 schrieb Lukasz Lenart:

2014-08-19 17:09 GMT+02:00 Fabian Richter frich...@mtg.de:

Hi,

when using paramsPrepareParamsStack with the convention plugin I'm getting
multiple errors/warnings in devMode=true:

Error setting expression 'token' with value
['5UVO47K811DQ15DUZF4QV2NQ8DHIHSUY', ]
Error setting expression 'token' with value
['5UVO47K811DQ15DUZF4QV2NQ8DHIHSUY', ]

At least one I got rid of by excluding these params (important is 'token'):

@InterceptorRefs({@InterceptorRef(value = paramsPrepareParamsStack, params
= {params.excludeParams,
struts.token,struts.token.name,token})})

But apparently only the first params interceptor in the stack uses these
params. The second one (the one after the prepare interceptor) only uses the
built-in excludeParams. So one of the above mentioned errors persists, which
is rather uncool :/

Bug or feature?


Feature and bug ;-) This kind of error report was introduced to inform
developer about possible typo in setter or value name in JSP, but you
are right, it's a bit annoying when something stupid like this clutter
the logs. Please fill an issue in JIRA.


Regards





smime.p7s
Description: S/MIME Cryptographic Signature


Re: paramsPrepareParamsStack and token interceptor

2014-08-21 Thread Lukasz Lenart
Great! Thanks!

2014-08-21 10:31 GMT+02:00 Fabian Richter frich...@mtg.de:
 Done, see WW-4390

 Am 20.08.2014 um 21:09 schrieb Lukasz Lenart:

 2014-08-19 17:09 GMT+02:00 Fabian Richter frich...@mtg.de:

 Hi,

 when using paramsPrepareParamsStack with the convention plugin I'm
 getting
 multiple errors/warnings in devMode=true:

 Error setting expression 'token' with value
 ['5UVO47K811DQ15DUZF4QV2NQ8DHIHSUY', ]
 Error setting expression 'token' with value
 ['5UVO47K811DQ15DUZF4QV2NQ8DHIHSUY', ]

 At least one I got rid of by excluding these params (important is
 'token'):

 @InterceptorRefs({@InterceptorRef(value = paramsPrepareParamsStack,
 params
 = {params.excludeParams,
 struts.token,struts.token.name,token})})

 But apparently only the first params interceptor in the stack uses these
 params. The second one (the one after the prepare interceptor) only uses
 the
 built-in excludeParams. So one of the above mentioned errors persists,
 which
 is rather uncool :/

 Bug or feature?


 Feature and bug ;-) This kind of error report was introduced to inform
 developer about possible typo in setter or value name in JSP, but you
 are right, it's a bit annoying when something stupid like this clutter
 the logs. Please fill an issue in JIRA.


 Regards



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts missing parameters

2014-08-21 Thread Luis Limas

On 20/08/2014 02:21 p. m., Lukasz Lenart wrote:

2014-08-09 4:22 GMT+02:00 Luis Limas luiscl...@hotmail.com:

On 08/08/2014 02:24 p. m., Lukasz Lenart wrote:

2014-08-08 17:38 GMT+02:00 Luis Limas luiscl...@hotmail.com:

Thanks again for the reply Lukasz, you misunderstood me, im not doing
serialize/deserialize my entities for any logic, the deserialize
instruction
is being called inside struts (Project: Struts 2 JSON Plugin,
JSONInterceptor.java : 123) when parsing JSON to Map (before calling the
setters inside JSONReader) and then to Object,  i mentioned the
deserialize
thing because there is where it seems to me that setters are not being
called. The serialize instruction i only use it for debuging purposes so
i
was able to see how it looks the populated (final) object,

Yes I know, but you're exposing Hibernate entity directly not some VO
- it always will be an issue, as you can see [1], JSONWriter already
contains some logic to detect Hibernate bean, but JSONReader can't do
that.


The issue seems to be that JSONWriter is not working propely. Also im not
sure to understand what do you mean with there's no way to do the
opposite, isn't JSONReader doing that?

...create proper Hibernate entity from JSON - only Hibernate can do
that and creating entities by hand can cause some problems like your.

To clarify few things:
- JSONWriter serializes an object to JSON (writes to request)
- JSONRead deserializes JSON into an object (reads from request)

As I understand you have problem with converting JSON into an object?
So in that case JSONReader and JSONPopulator are involved.

[1]
https://github.com/apache/struts/blob/aa744b811f9c41b80cc30ad6cf41ccaa75da5323/plugins/json/src/main/java/org/apache/struts2/json/JSONWriter.java#L290-L312


Regards

My problem is that struts calls JSONReader when using SMDMethod=true to
convert JSON to Object. And so on, JSONReader fails to do the conversion.

This is an example of SMDMethod im calling

@SMDMethod
public String mySMDMethod(Request obj /*I showed Request.java at previews
mail */) {
 if(obj.getId() == null) {
 System.out.println(Unexpected behavior, actually the JSON sended
from client was {id:99}. Somehow struts didn't managed to populate );
 }
 //logic stuff...
 return succesfull example;
}

At client side im sending always at least a JSON like this {id:99}.

So you think this issue ocurrs because the obj parameter at mySMDMethod
is an entity? that means that the issue should cease to happen by just
removing all hibernate annotations?? (because thats the only special thing
about entities at this call)

Thanks for your kind help :)

Did you try to setup higher level for logger used with JSON plugin?

ie.
log4j.logger.org.apache.struts2.json = debug


Regards

Yep, but by using log4j XML configuration:

category name=com.opensymphony.xwork2.interceptor
additivity=false
priority value=DEBUG /
appender-ref ref=basic /
/category
category name=com.opensymphony.xwork2.ognl.OgnlValueStack
additivity=false
priority value=WARN /
appender-ref ref=basic /
/category

I've suspended trying to solve the issue by now, i'll restart my
research next week, i'll post everything i've found at the mailing list
at that time,

Right now i'm just restarting tomcat to solve the issue temporarily, yet
i haven't seen any tomcat log,

Thanks for your time :)



---
Este mensaje no contiene virus ni malware porque la protección de avast! 
Antivirus está activa.
http://www.avast.com


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts missing parameters

2014-08-21 Thread Lukasz Lenart
2014-08-21 19:14 GMT+02:00 Luis Limas luiscl...@hotmail.com:
 Yep, but by using log4j XML configuration:

 category name=com.opensymphony.xwork2.interceptor additivity=false
 priority value=DEBUG /
 appender-ref ref=basic /
 /category
 category name=com.opensymphony.xwork2.ognl.OgnlValueStack
 additivity=false
 priority value=WARN /
 appender-ref ref=basic /
 /category

 I've suspended trying to solve the issue by now, i'll restart my research
 next week, i'll post everything i've found at the mailing list at that time,

 Right now i'm just restarting tomcat to solve the issue temporarily, yet i
 haven't seen any tomcat log,

Great but please add the below to your log4j configuration

category name=org.apache.struts2.json additivity=false
 priority value=DEBUG /
  appender-ref ref=basic /
/category


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts missing parameters

2014-08-21 Thread Luis Limas

On 21/08/2014 01:24 p. m., Lukasz Lenart wrote:

2014-08-21 19:14 GMT+02:00 Luis Limas luiscl...@hotmail.com:

Yep, but by using log4j XML configuration:

 category name=com.opensymphony.xwork2.interceptor additivity=false
 priority value=DEBUG /
 appender-ref ref=basic /
 /category
 category name=com.opensymphony.xwork2.ognl.OgnlValueStack
additivity=false
 priority value=WARN /
 appender-ref ref=basic /
 /category

I've suspended trying to solve the issue by now, i'll restart my research
next week, i'll post everything i've found at the mailing list at that time,

Right now i'm just restarting tomcat to solve the issue temporarily, yet i
haven't seen any tomcat log,

Great but please add the below to your log4j configuration

category name=org.apache.struts2.json additivity=false
  priority value=DEBUG /
   appender-ref ref=basic /
/category


Regards

Done :)

Thank you,

---
Este mensaje no contiene virus ni malware porque la protección de avast! 
Antivirus está activa.
http://www.avast.com


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org