Announcement Announcement Module
Collapse
No announcement yet.
how to add xsl stylesheet to spring REST and JAXB? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #2
    I needed something like that just for debugging, and solved it by setting a Link HTTP header field instead (Firefox only).

    Comment


    • #3
      Thanks for the answer Julian. Unfortunately it's not really going to be enough for me.

      Comment


      • #4
        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
        @XmlHeader

        http://docs.redhat.com/docs/en-US/JB..._provider.html

        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, 11:44 AM.

        Comment


        • #5
          Does someone know how to add xsl using spring mvc? I haven't been able to work out how to do this yet......

          Comment


          • #6
            Originally posted by jonathanW View Post
            Does someone know how to add xsl using spring mvc? I haven't been able to work out how to do this yet......
            Try ReXSL instead. It's a lightweight MVC framework, with XSL and JAXB.

            Comment

            Working...
            X