• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Spring application, soap webservice returning Html response

 
Greenhorn
Posts: 24
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a scenario, where in from my spring application I am communicating with a soap webservice that returns HTML response something like below:

<![CDATA[<HTML><HEAD></HEAD><BODY>................<script language="javascript">...</script>></BODY></HTML>]]>

Now I have to render this response in the browser, this HTML code is basically redirecting to another site.

My approach: we can set this html response in the request in spring controller, and after this we can forward the request to a blank jsp, and onload of blank jsp we can retrieve the html set in the request and render it using innerHtml,
and once the html is rendered it can redirect to a different site.

Please suggest if this is good appraoach or there is some other to achieve this.

Thanks,
Shiv
 
Ranch Hand
Posts: 37
jQuery Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just so I understand, you get back HTML from a web service response and the HTML contains JavaScript that redirects the user? Is there an alternate way you may be able to parse out the redirect location and redirect from your controller?
 
Shiv Vishwakarma
Greenhorn
Posts: 24
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A correction to the requirement, webservice is returning a html page, which has hidden fields and in the body tag itself there is a function which submit the form with hidden fields and action path of the form is of a third application, my earlier was based on assumptions, but now it is bit more clear...
so from controller we cannot redirect to the url, we have to navigate it the user to the client, but now the question about rendering the html received from webservice, was approach to it was correct.

Thanks,
Shiv
 
The harder you work, the luckier you get. This tiny ad brings luck - just not good luck or bad luck.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic