Does this possible?
In source code:
Object org.apache.struts2.json.JSONPopulator.convertPrimitive(Class
clazz, Object value, Method method) throws JSONException {
if (value == null) {
if (Short.TYPE.equals(clazz) || Short.class.equals(clazz))
return (short) 0;
2010/11/24 Martin Gainty
> if the attribute is available in object acquired by
> invocation.getAction() then you should see the target
>
> does this answer your question?
>
Actually, It doesn't.
I meant that conversion methods like convertPrimitive (see the code below)
use to take class type a
t et n'aura pas n'importe
quel effet légalement obligatoire. Étant donné que les email peuvent facilement
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
pour le contenu fourni.
> Date: Wed, 24 Nov 2010 20:16:45 +0800
> Subject: Re: JSON plugin s
Thanks,Maurizio,
This is not a wrong approach.
but can be take a improved for easier use. :P
Regards.
On Tue, Nov 23, 2010 at 12:10 PM, Maurizio Cucchiara
wrote:
> Hi Knight,
> I take your point, JSONPopulator.convertPrimitive function maybe uses a
> wrong approach.
> Does anyone know why conv
Hi Knight,
I take your point, JSONPopulator.convertPrimitive function maybe uses a
wrong approach.
Does anyone know why convert method process is driven by value and type
instead of target type only?
2010/11/23 Knight Chen
> Hi All,
> Thanks for reply, and sorry for my poor English.
>
> In this
Hi All,
Thanks for reply, and sorry for my poor English.
In this case:
I have a POJO:
public class UserDTO {
private int age;
...
public void setAge(int age) {
this.age = age;
}
}
And Action has a property with this type:
public Class UserAction {
priv
I'm not sure understand what you mean, it could be ognl conversion related.
For further details, could you provide the NPE stack?
2010/11/22 Knight Chen
> Hi all,
>
> I often encounter Number format exception when I use JSON plugin to
> parse input String "" from AJAX request to Number,
> becaus
Hello Knight,
I think you can change the Value-Object(Model obj), modify the get method
code:
if(this.value.equal("")){
this.value=null;
or
this.value=0
}
You can pass a Value-Object to server side, instead of Json-Text formation.
Regards,
Mead
On Mon, Nov 22, 2010 at 8:12 PM, K
8 matches
Mail list logo