Sep 5th, 2011, 04:29 AM
how to add xsl stylesheet to spring REST and JAXB?
I'd like to add this stylesheet to the top of some of my spring REST responses. Any way of doing this? Obviously if I get a writer and do it in the controller method then return the JAXB2 generated objects in the controller method it throws a 500 internal error.
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="sources.xsl"?>
Any suggestions? This must be a common scenario but I've not found any answers through google and searching this forum?
Sep 5th, 2011, 06:04 AM
I needed something like that just for debugging, and solved it by setting a Link HTTP header field instead (Firefox only).
Sep 9th, 2011, 10:32 AM
Thanks for the answer Julian. Unfortunately it's not really going to be enough for me.
Sep 9th, 2011, 10:35 AM
I've been looking around some more and RestEasy seems to have something spring should have, although this isn't ideal either, as it means modifying my autogenerated jaxb objects every time after they are generated
I wonder if I can use this in the spring framework? As it is this annotation isn't supported.
Last edited by jonathanW; Sep 9th, 2011 at 10:44 AM.
Sep 22nd, 2011, 03:14 AM
Does someone know how to add xsl using spring mvc? I haven't been able to work out how to do this yet......
Apr 23rd, 2012, 06:15 AM
Try ReXSL instead. It's a lightweight MVC framework, with XSL and JAXB.
Originally Posted by jonathanW