Announcement Announcement Module
Collapse
No announcement yet.
Adding XML REST to Roo Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding XML REST to Roo

    Hi all,

    I just upgraded to the latest roo and love the "json all" addition. I would like to also have a way to do the same thing but return XML rather than a json payload. I also need to create some custom services that return XML.

    What is the recommended best practice for getting that into the project without messing up the already supported json views?

    Thanks,
    Mark

  • #2
    There is an external add-on which installs Springs ContentNegotiatingViewResolver. So you need to search the add-on first:

    addon search "Content Negotiating View Resolver"

    then install it and use it. Use 'addon info' to see details about its intended usage.

    You should use a Roo 1.1.2 snapshot build to do this: http://static.springsource.org/downl...hp?project=ROO

    Comment


    • #3
      Addon "Content Negotiating View Resolver" not working

      I can't get "Content Negotiating View Resolver" addon to work. Please see errors below.

      roo> addon install id --searchResultId 43
      Target resource(s):
      -------------------
      net.tzolov.httprepresentations.roo.addon (1.1.6)

      Deploying...done.

      Successfully installed add-on: net.tzolov.httprepresentations.roo.addon [version
      : 1.1.6]
      [Hint] Please consider rating this add-on with the following command:
      [Hint] addon feedback bundle --bundleSymbolicName net.tzolov.httprepresentations
      .roo.addon --rating ... --comment "..."
      roo> http resource representation setup
      Exception in thread "Spring Roo JLine Shell" java.lang.NoSuchMethodError: org.sp
      ringframework.roo.project.ProjectOperations.depend encyUpdate(Lorg/springframewor
      k/roo/project/DependencyV
      at net.tzolov.httprepresentations.roo.addon.HttpResou rceRepresentationOp
      erationsImpl.updateDependencies(HttpResourceRepres entationOperationsImpl.java:16
      3)
      at net.tzolov.httprepresentations.roo.addon.HttpResou rceRepresentationOp
      erationsImpl.installHttpResourceRepresentation(Htt pResourceRepresentationOperati
      onsImpl.java:80)
      at net.tzolov.httprepresentations.roo.addon.HttpResou rceRepresentationCo
      mmands.installHttpResourceRepresentation(HttpResou rceRepresentationCommands.java
      :31)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.springframework.roo.support.util.ReflectionUti ls.invokeMethod(Ref
      lectionUtils.java:191)
      at org.springframework.roo.process.manager.ProcessMan agerHostedExecution
      Strategy$1.callback(ProcessManagerHostedExecutionS trategy.java:49)
      at org.springframework.roo.process.manager.internal.D efaultProcessManage
      r.doTransactionally(DefaultProcessManager.java:180 )
      at org.springframework.roo.process.manager.internal.D efaultProcessManage
      r.execute(DefaultProcessManager.java:143)
      at org.springframework.roo.process.manager.ProcessMan agerHostedExecution
      Strategy.execute(ProcessManagerHostedExecutionStra tegy.java:47)
      at org.springframework.roo.shell.AbstractShell.execut eCommand(AbstractSh
      ell.java:165)
      at org.springframework.roo.shell.jline.JLineShell.pro mptLoop(JLineShell.
      java:358)
      at org.springframework.roo.shell.jline.JLineShell.run (JLineShell.java:13
      2)
      at java.lang.Thread.run(Unknown Source)

      Comment

      Working...
      X