现在的位置: 首页 > 综合 > 正文

jsp struts2页面跳转

2017年12月24日 ⁄ 综合 ⁄ 共 851字 ⁄ 字号 评论关闭

<body>
<form  action="<%=request.getContextPath()%>/JZAccount/login.action"  method="post">
        <table align="center" >
            <tr>
                <td><s:textfield name="user_name" label="用户名"></s:textfield></td>
            </tr>
            <tr>
                <td><s:password name="user_passwd" label="密码" ></s:password></td>
            </tr>
            <tr>
                <td align="center">
                <s:submit value="登录"></s:submit>
                <input type="button" value="注册" onclick="Regist()" />
                </td>
            </tr>
            <tr>
                <td>
                <s:fielderror></s:fielderror>
                </td>
            </tr>
        </table>
    </form>
    <script type="text/javascript">
     function Regist(){
        var    targetForm=this.document.forms[0];
         targetForm.action="<%=request.getContextPath()%>/JZAccount/toRegist.action";
         targetForm.submit();
     }
    </script>
</body>

【上篇】
【下篇】

抱歉!评论已关闭.