zoukankan      html  css  js  c++  java
  • jQuery刷新包含的<jsp:include>页面

    JQuery刷新包含页面,以下两种形式均可:

     <%@include file="../include/header.jsp" %> 
     <jsp:include page
    ="../include/header.jsp"></jsp:include>

    参考:http://designgala.com/how-to-refresh-div-using-jquery/
    我们的页面一般包含几个页面,每个页面都是一个JSP,当我们用Jquery 向后台提交数据后,根据结果想刷新某一页面如(header.jsp),则可用 Jquery的 Div的load 方法:
    $("#divName").load(url, data, callback);url为要刷新的子页面.

    注意: Struts2 的Action设置返回类型为Json时其属性值在页面用ognl表达式将无法取到值,如果需要可以将值手动设置到范围对象。

    参考代码:

    Java代码  收藏代码
    1.     <body>  
    2.         <%@include file="../include/header.jsp" %>  
    3.         <input type="button" value="submit" id="button1"/>  
    4.     </body> 
    5.  
    6.     <script type="text/javascript">  
    7.         $(document).ready(function(){  
    8.             $("#button1").click(function(){  //点击事件
    9.                $("#header").load("../include/header.jsp");  //重新加载包含的jsp页面
    10.             });  
    11.         });  
    12.     </script>
  • 相关阅读:
    metadata的使用以及简单的orm模式
    python的cache修饰器
    聊天服务的设计随想
    cherrypy入门
    用python做分布式定时器
    cherrypy & gevent patch
    Python Tornado简单的http request
    连接池的一些感悟
    企业系统架构评估标准
    Nginx与python web服务配置(Uwsgi& FastCGI)
  • 原文地址:https://www.cnblogs.com/limeiky/p/6208401.html
Copyright © 2011-2022 走看看