Skip to content

Instantly share code, notes, and snippets.

@lucascs
Created July 4, 2011 18:14
Show Gist options
  • Save lucascs/1063738 to your computer and use it in GitHub Desktop.
Save lucascs/1063738 to your computer and use it in GitHub Desktop.
overriding json serialization from VRaptor to cope with dates
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