[OpenLayers-Users] proxyhost using window url parameters

albert valls avalls at ngeografics.com
Tue Mar 10 06:44:05 EDT 2009



I've found the solution by myself.

the problem is with the  OpenLayers.Ajax.Request. If you don't pass a
'parameters' option then it gets the parameters from the window url:

	new OpenLayers.Ajax.Request(url, 
		 {	method: 'post'
			,onComplete: success
			,onFailure: failure
			,parameters: null //<<<<< solution
		  }
	);

bye.



albert valls wrote:
> 
> hi list,
> 
> I've found this problem... when using the proxy for the ajax queries, the
> proxy adds the window url parameters to the request. Let me explain with a
> sample:
> 
> window.location.url: "http://server/index.jsp?param1=value1&param2=value2
> 
> then, when a query is retreived with a OpenLayers.ProxyHost defined, the
> param1 and param2 are added. I can see something like:
> 
> http://server/proxy.jsp?url=http://otherserver/dataquery?....&param1=value1&param2=value2.
> 
> And taking a look at the code from Openlayers/Request.js I've found:
> 
> OpenLayers.Request = {
>     
>     /**
>      * Constant: DEFAULT_CONFIG
>      * {Object} Default configuration for all requests.
>      */
>     DEFAULT_CONFIG: {
>         method: "GET",
>         url: window.location.href, //<<<<<<<<<<<<<<
>         ....
> 
> I'm missing something or there's no way of disabling this behaviour???
> Sometimes maybe good to forward the parameters, but I think that should be
> the option to disable it. 
> Any comment? Should I open a new ticket for this?
> 
> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/proxyhost-using-window-url-parameters-tp2450321p2454449.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list