struts2 ajax 报错

来源:互联网 发布:五十音图早道软件 编辑:程序博客网 时间:2024/05/17 06:25

第一个问题:
1.struts2-dojo-plugin-2.1.2.jar引入到自己的项目中。
2.jsp中加入如下内容  
<%@ page language="java" pageEncoding="UTF-8"%>  
<%@ taglib prefix="s" uri="/ struts-tags" %>  
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
 3.<head>中加入下列  

  <s:head theme="xhtml"/>  
  <sx:head parseContent="true"/>

 

 

使用sx标签  
<sx:submit 
        validate="true"                        //ajax验证
        ajaxAfterValidation="true"    //这个表示验证通过后,提交,但不跳转
        targets="response"              //这个表示响应的内容填充到id=response的div中
        showLoadingText="false"/>
</s:form>