DWR 跨域

<servlet>
		<servlet-name>dwr-invoker</servlet-name>
		<servlet- class>
			org.directwebremoting.servlet.DwrServlet
			</servlet-class>
			<init-param>
				<param-name>debug</param-name>
				<param-value>true</param-value>
			</init-param>
			<init-param>
				<param- name>
					allowGetForSafariButMakeForgeryEasier
					</param-name>
					<param-value>true</param-value>
			</init-param>

			<! – crossDomainSessionSecurity:设置成false能够从其他域进行请求 –>
			
			
			<init-param> 
				<param-name>crossDomainSessionSecurity</param-name>
				 <param-value>false</param-value> </init-param> 
			 <init-param>
			 <param-name>allowScriptTagRemoting</param-name> 
			 <param-value>true</param-value> </init-param> 

			<load-on-startup>1</load-on-startup> 
	</servlet>



<script type='text/javascript' src='http://a.com/dwr/interface/regutil.js'></script>
<script type='text/javascript' src='http://a.com/dwr/engine.js'></script>

<script type='text/javascript' src='http://a.com/dwr/util.js'></script>


DWREngine.setMethod(DWREngine.ScriptTag);
regutil._path = 'http://sso.dxy.cn/dwr/';


调用方法 出现  XMLHttpRequest.open 时权限不足



网上搜索了下 很多人说是 firefox的bug



再次搜索  看到scripttag 能搞定此问题



把js  的引入 改成 动态 加载 果然可以了 哈哈 。



注意点:dwr jar需要是2.0.2



你可能感兴趣的:(java,servlet,DWR,SSO,firefox)