This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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
 
Similar Threads
Struts 2 Remote Div Problem
not getting time in action class from dojo tag <sx:datetimepicker type="time"/> in jsp (Struts2)
Struts2 + JSON : Getting Class Not Found Error
Struts2-json plugin not serializing action class to json
struts2 + json plugin problems