Created
July 4, 2011 18:14
-
-
Save lucascs/1063738 to your computer and use it in GitHub Desktop.
overriding json serialization from VRaptor to cope with dates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.thoughtworks.xstream.converters.basic.DateConverter; | |
@Component | |
public class CustomJSONSerialization extends XStreamJSONSerialization { | |
public CustomJSONSerialization(HttpServletResponse response,TypeNameExtractor extractor, ProxyInitializer initializer) { | |
super(response, extractor, initializer); | |
} | |
@Override | |
public XStream getXStream() { | |
XStream xstream = super.getXStream(); | |
xstream.registerConverter(new DateConverter("dd/MM/yyyy", new String[0])); | |
return xstream; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment