File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes How to implement Cross origin resource sharing in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to implement Cross origin resource sharing in JSP" Watch "How to implement Cross origin resource sharing in JSP" New topic
Author

How to implement Cross origin resource sharing in JSP

Amit K Jain
Ranch Hand

Joined: Nov 06, 2008
Posts: 55
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

Joined: Jan 10, 2002
Posts: 60053
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Amit K Jain
Ranch Hand

Joined: Nov 06, 2008
Posts: 55
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
JavaScript can not read the other domain. CORS will not help with a pop up window.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to implement Cross origin resource sharing in JSP
 
Similar Threads
Randon "Access is Denied" error
Ajax responseXML problem
Declarative security in web.xml?? is this secure??
Error while manipulating parent window URL in child window
load array at another time