Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

i have a problem with HTTP request for KML to add to map. This is my HTTP request:

var x = new OpenLayers.Layer.Vector("X", {
    projection: new OpenLayers.Projection("EPSG:4326"),
    strategies: [new OpenLayers.Strategy.Fixed()],

    protocol: new OpenLayers.Protocol.HTTP({                                    
                url : "../../MyJSP.jsp",                    
                async : false,
                    format: new OpenLayers.Format.KML({
                       extractStyles: true,
                       extractAttributes: true
                     }),

                params : {
                 'request' : 'typeRequest',
                 'param1' : 'a',
         'param2' :'b'                      
            }

            })

        });             


        map.addLayer([x]);

The request is send to MyJSP, which make some controls to decide the remote method to invoke:

String req = request.getParameter("request")==null ? "" : request.getParameter("request");

if (req.equals("typeRequest")) {    
   String param1= request.getParameter("param1");
   String param2 =   request.getParameter("param2");                
   myClass.myMethod(param1,param2);     

The request don't arrive here. I think that the problem is the URL ../../MyJSP.jsp.

-forder
 -- folder
 --- folder
       class to make request HTTP 
-MyJsp.jsp

Can anybody help me? Thanks.

share|improve this question
1  
what is firebug telling you? are you getting a 404 on the request? –  CaptDragon Oct 26 '12 at 12:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.