0

I am working on a small java web application using netbeans which uses Apache Tomcat.

I got the solr running, and I can make the queries. But its running as a separate app on a different port(8983). So when I do a query to this app from my web app from java script I get the CORS error. I know that the reason of this error is the cross origin policy. So I wanted to know how can I make solr and my web app work as a complete single app using netbeans. Also I am not allowed to change the server policy to accept request from some different domain.

Thank You.

1 Answer 1

0

You might consider using JSONP to bypass the CORS issue. See Solr with JSONP with JQuery for an example of how to query Solr using JSONP.

Update:

Since JSONP is not an option in your scenario, the way to make them both a single app is to use EmbeddedSolrServer that is part of the SolrJ Java Client.

2
  • Thanks for reply, but as I said I don't have to touch the CORS issue. Is there any way to run both modules as a single app? Feb 22, 2013 at 6:45
  • Ok, thought that JSONP might be an option for you. Since it is not, I have updated my answer.
    – Paige Cook
    Feb 22, 2013 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.