ajax与ring结合_Ajax编程_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

ajax与ring结合

作者:黑客防线网安Ajax教程基地 来源:黑客防线网安Ajax教程基地 浏览次数:0

本篇关键词:ajaxring
黑客防线网安网讯:  Spring的集成几乎异常简单,只需要更改配置文件而已.  页面的代码不用动,Spring的集成几乎异常简单,只需要更改配置文件而已.页面的代码不用动,例如

  Spring的集成几乎异常简单,只需要更改配置文件而已.页面的代码不用动例如

  doc.simple-spring.jsp

  <script language="javascript">var springEndPoint="<%=request.getContextPath()%>/remoting/Spring-buffalo";function pageMethod() { var buffalo = new Buffalo(springEndPoint); buffalo.remoteCall("yourObject.yourMethod",[], function(reply) {  var Obj = reply.getResult(); })}</script>

  web部署描述文件

 

  web.xml

  <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE web-app PUBLIC "-//******* Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.*******.com/dtd/web-app_2_3.dtd"><web-app>    <display-name>Buffalo Web Remoting Demostration Application</display-name> <context-param>  <param-name>contextConfigLocation</param-name>  <param-value>   /WEB-INF/applicationContext.xml  </param-value> </context-param> <servlet>  <servlet-name>context</servlet-name>  <servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>  <load-on-startup>1</load-on-startup> </servlet>  <servlet>  <servlet-name>remoting</servlet-name>  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>  <load-on-startup>4</load-on-startup> </servlet>  <servlet-mapping>  <servlet-name>remoting</servlet-name>  <url-pattern>/remoting/*</url-pattern> </servlet-mapping> </web-app>

  以前的buffalo-service.properties文件则不用,applicationContext.xml所替代之.其中引用到的bean可以是任意被Spring托管的bean.这个Controller可以被任意任意方式的ServletDispather调用.

 

  applicationContext.xml

  <beans>  <bean name="simpleService" class="net.buffalo.demo.simple.SimpleService"></bean> <bean name="numberService" class="net.buffalo.demo.numberguess.NumberGuessService"></bean> </beans>

  remoting-servlet.xml

  <beans>  <bean name="/Spring-buffalo" class="net.buffalo.spring.BuffaloServiceExporter"> <property name="services">            <map>                <entry key="simpleService">                    <ref bean="simpleService"/>                </entry>  <entry key="numberService">                    <ref bean="numberService"/>                </entry>            </map>        </property>  </bean> </beans>

  

    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-15518-1.html
网站维护教程更新时间:2023-02-16 13:52:30  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer