mule3中ajax组件的使用

话不多说,直接怎么使用。

一.HTML页面等资源由mule自己管理,访问mule的ajax服务器:

xml配置:

   
    
       
       
   

前端页面:hello.html(所在位置,src/main/app/docroot/hello.html)





hello

    
   


 


       姓名: 
       年龄:
       
   

     


  首页

注:浏览器输入请求路径:http://localhost:8080/test/hello.html定位到HTML页面,点击其按钮可实现ajax的局部刷新,点击首页超链接可跳转到index.html页面。

二.自定义页面访问mule的ajax服务器:

xml配置:


   
       
       
   

前端页面:hello.html(所在位置,src/main/app/webapps/WEB-INF/hello.html) 

导入mule.js(mule.js在mule-mule-transport-ajax-3.8.0.jar中, 用解压软件解压把其中的js目录复制到WEB-INF目录下。)

下载链接:https://download.csdn.net/download/s_first/10974031

maven引入:


    org.mule.transports
    mule-transport-ajax
    3.8.0

     

页面代码:                        





hello

    
   


 


       姓名: 
       年龄:
       
   

     


  首页

注:浏览器输入请求路径:http://localhost:8080/WEB-INF/hello.html定位到HTML页面,点击其按钮可实现ajax的局部刷新,点击首页超链接可跳转到index.html页面。

你可能感兴趣的:(mule)