index.jsp 971 Bytes
<%@ include file="/WEB-INF/jsp/include/taglib.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--添加此行消除额外空格--%>
<%@ page trimDirectiveWhitespaces="true" %>
<%--添加此行消除额外空格--%>

<jsp:include page="/WEB-INF/jsp/include/header.jsp">
    <jsp:param name="pageTitle" value="form-index"/>
</jsp:include>

<p>普通html表单需手动添加csrf</p>
<%--@elvariable id="_csrf" type="org.springframework.security.web.csrf.CsrfToken"--%>
<input name="${_csrf.parameterName}" value="${_csrf.token}">
<%--@elvariable id="simpleForm" type="com.dookay.jsp.demo.form.form.SimpleForm"--%>
<form:form action="/form/simple" modelAttribute="simpleForm" cssClass="j_ajaxForm">
    <p>
        姓名:<form:input path="name"/>
    </p>
    <p>
        手机号:<form:input path="mobile"/>
    </p>
    <p>
        <form:button>提交</form:button>
    </p>
</form:form>
<jsp:include page="/WEB-INF/jsp/include/footer.jsp"/>