Struts2会进入Action,但不执行里面包括execute的任何方法!求帮助!
Struts2能进入Action,但不执行里面包括execute的任何方法!!求帮助!!
login.jsp页
struts配置:
login.jsp页
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登陆系统</title>
</head>
<body>
<%@include file="common/header.jsp"%>
<table width="780" align="center" background="<%=ctx%>/images/bodybg.jpg">
<tr>
<td>
<h6>请输入用户名和密码来登陆<br></h6>
<s:if test="tip!=null">
<div class="error">
<s:property value="tip"/>
</div>
</s:if>
<s:actionerror cssClass="error"/>
<s:form action="login.action" name="form1" method="execute">
<s:textfield name="username" label="用户名"/>
<s:password name="password" label="密码"/>
<tr>
<td colspan="2">
<s:submit value="登录" theme="simple"/>
<s:reset theme="simple" value="重置" />
</td>
</tr>
</s:form>
</td>
</tr>
</table>
<%@include file="common/footer.jsp"%>
</body>
</html>
struts配置:
<struts>
<constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory"/>
<!-- <constant name="struts.enable.DynamicMethodInvocation" value="false" /> -->
<!-- 允许action的名字中出现"/" -->
<constant name="struts.enable.SlashesInActionNames" value="true"/>
<!-- 配置了系列常量 -->
<constant name="struts.custom.i18n.resources" value="mess"/>
<constant name="struts.i18n.encoding" value="UTF-8"/>
<package name="default" extends="struts-default" abstract="true">
<!-- 定义全局Result映射 -->
<global-results>
<result name="exception">/WEB-INF/jsp/error/error.jsp</result>
<!-- 定义login逻辑视图对应的视图资源 -->
<result name="login">/WEB-INF/jsp/login.jsp</result>
</global-results>
<global-exception-mappings>
<!-- 定义全局异常映射 -->
<exception-mapping result="exception" exception="java.lang.Exception" />
</global-exception-mappings>