Results 1 to 6 of 6

Thread: how to add xsl stylesheet to spring REST and JAXB?

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Posts
    6

    Default 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. #2

    Default

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

  3. #3
    Join Date
    Aug 2011
    Posts
    6

    Default

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

  4. #4
    Join Date
    Aug 2011
    Posts
    6

    Default

    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 at 10:44 AM.

  5. #5
    Join Date
    Aug 2011
    Posts
    6

    Default

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

  6. #6
    Join Date
    May 2011
    Posts
    3

    Default

    Quote 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •