Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Spring REST controller redirection

 
Bartender
Posts: 3648
16
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
Hello

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.



 
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic