Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to implement Cross origin resource sharing in JSP

 
Amit K Jain
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Could you please guide me on this?

I have to web applications running on two different servers. I am trying to open a page on one server in new window from the page on another server, however I get the error access denied.

e.g.
this is the parent URL: http://102.12.12.21:9083/support/openair_test.html?action=paint;id=511 on which I have a hyperlink pointing to the link http://localhost:9085/EPOApp/child.jsp.

Below are the snippet:
On the parent page I have

< a onclick="window.open('http://localhost:9085/EPOApp/child.jsp');">EPO < /a>


In child.jsp below is the Javascript code to read the parent url on onload event.



Can someone please help how to resolve this issue? If it is a 'cross origin resource sharing' concept, how can it be implemented here.

Thanks
Amit
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64844
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose an appropriate forum for your posts. This forum is for questions on JSP, not JavaScript. For more information, please click this link ⇒ CarefullyChooseOneForum.

This post has been moved to a more appropriate forum.
 
Amit K Jain
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

Sorry if I posted it at wrong place.
My question is more on JSP application and I put the Javascript code to mention what I tried. I am certainly not expecting the answer from Javascript point of view only. It can be any solution that can be implemented in JSP web application.


Thanks
Amit
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript can not read the other domain. CORS will not help with a pop up window.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic