0

This is my jQuery AJAX code and this javascript file is placed in

C:\workspace\search-ui\search-ui\src\main\webapp\themes\client\javascript\agile.js

And I want to call proxy.jsp file from this jQuery AJAX, and my jsp file is in

C:\workspace\search-ui\search-ui\src\main\webapp\WEB-INF\pages

so what will be the url field of AJAX call.. Any suggestions will be appreciated..

This AJAX jquery code is in Javascript file called agile.js and I have to call proxy.jsp page from this javascript file

var on_show_info = function() {
    var outOfDomainAjaxCall = search_metadata + current_doc_info.id;
    alert(outOfDomainAjaxCall);
                request_meta_info = $.ajax({
                url: "proxy.jsp?url=" + outOfDomainAjaxCall,
                type: 'GET',
                success: on_get_metadata,
                error: on_get_metadata_error

        });
    };
13
  • where is this ajax being called? Commented Jun 28, 2011 at 18:16
  • @Neal, locally on the eclipse.. And if it works fine then I have to deploy on server.. Commented Jun 28, 2011 at 18:18
  • whats the file location? Commented Jun 28, 2011 at 18:20
  • @Neal, I have written file location in my questions.. And which location u r talkign about.. Commented Jun 28, 2011 at 18:25
  • OF THE FILE THAT IS DOING THE AJAX.... not the jsp or the jquery.js file Commented Jun 28, 2011 at 18:25

3 Answers 3

1

You are calling the script from: C:\workspace\agilesearch-ui\agilesearch-ui\src\main\webapp\WEB-INF\pages\search.jsp

And the page you are trying to reach is: C:\workspace\agilesearch-ui\agilesearch-ui\src\main\webapp\WEB-INF\pages\proxy.jsp

Change your code to:

var on_show_info_agile = function() {
            //alert("aa");
var outOfDomainAjaxCall = search_agile_metadata + current_doc_info.id;
alert(outOfDomainAjaxCall);
            request_meta_info = $.ajax({
            url: "proxy.jsp",
            data: "url=" + outOfDomainAjaxCall, //put the data here
            type: 'GET',
            success: on_get_metadata_agile,
            error: on_get_metadata_agile_error

    });



};
Sign up to request clarification or add additional context in comments.

Comments

0

It should be:

"../../../WEB-INF/pages/proxy.jsp?url=" + outOfDomainAjaxCall

3 Comments

@YonoRan, I tried with this.. still m getting error.. <body><h2>HTTP ERROR 404</h2> <p>Problem accessing /WEB-INF/pages/proxy.jsp. Reason: <pre> NOT_FOUND</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>
and your sure that the locations of the files are just the way you specified them up top? so where is the function being called from? you say that the js file is in the directory that you specified, but where is the file that calling the ajax call?
Trying to ascertain where the ajax call is being made from. If something has to be calling the ajax call... so where is that file? what directory? not the js file... the actual file making the ajax call
0
".../WEB-INF/pages" + outOfDomainAjaxCall,
            type: 'GET',
            success: on_get_metadata_agile,
            error: on_get_metadata_agile_error

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.