• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Spring REST controller redirection

Posts: 3648
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have 2 spring apps say call them clientApp (web client) and serviceApp (REST web service taking in JSON parameter).

These apps are on separate machines: clientApp is in a DMZ and serviceApp is in the company internal network.

In the clientApp, I have a class that calls the REST web services according. However, this clientApp also acts as a interface/wrapper for third parties/ vendors to call.

Let say there is the "search" function. In the serviceApp it looks like:

In the clientApp, instead of doing this:

From the above, the JSON conversion code is done twice, once in client and again in server.

How to set up the client code to redirect to the serviceApp directly?

I did try the "redirect:...." approach but that works only for views, which mine isn't. If redirect approach, not sure how that json string will get through? using @ResponseBody, but I think it's for objects not for json-ed strings.

Any ideas or examples are welcome.

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic