Results 1 to 3 of 3

Thread: Adding XML REST to Roo

  1. #1
    Join Date
    Nov 2010
    Posts
    9

    Default 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. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    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
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

  3. #3
    Join Date
    Jan 2011
    Location
    Newton, MA
    Posts
    22

    Default 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)

Posting Permissions

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