aspose file tools*
The moose likes Struts and the fly likes JSON plugin ignoring some types Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSON plugin ignoring some types" Watch "JSON plugin ignoring some types" New topic
Author

JSON plugin ignoring some types

Emir Bugra Koksalan
Greenhorn

Joined: Aug 23, 2012
Posts: 9

Hello everybody.
I'm using struts and json plugin. I have a class that have some properties and properties have type of org.joda.time.DateTimeFieldType. Json plugin trying to convert all classes to json and of course DAteTimeFieldType's properties too. Some properties which in the DateTimeFieldType has StandardDateTimeFieldType and this class is private and json plugin throws illegal access exception of course :'( I dont want that. Struts must not look at deep of every class.

I used xwork-conversion-properties but no good result. My xwork file is:

org.joda.time.DateTimeFieldType = org.kodmanyagha.strutsexample.StandardDateTimeFieldTypeConverter
org.joda.time.DateTimeFieldType.StandardDateTimeFieldType = org.kodmanyagha.strutsexample.StandardDateTimeFieldTypeConverter

How can I block struts when coming to DateTimeFieldType?

I will break my head at last Please help meeee


www.kodmanyagha.org
Emir Bugra Koksalan
Greenhorn

Joined: Aug 23, 2012
Posts: 9

I forgot write the error:

Class org.apache.struts2.json.JSONWriter can not access a member of class org.joda.time.DateTimeFieldType$StandardDateTimeFieldType with modifiers "public"

I hope somebody got that error and solved...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSON plugin ignoring some types