<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="useraction" extends="struts-default" >
<action name="LoginAction" class="action.Actions" >
<result>success.jsp</result>
<result name="error">error.jsp</result>
</action>
</package>
</struts><?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter> <filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<form action="LoginAction" method="post">
<input type="submit" value="提交"/>
</form>
</body>
</html>
哪位眼睛好的帮忙看下,找得好蛋疼啊
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="useraction" extends="struts-default" >
<action name="LoginAction" class="action.Actions" >
<result>success.jsp</result>
<result name="error">error.jsp</result>
</action>
</package>
</struts><?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter> <filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<form action="LoginAction" method="post">
<input type="submit" value="提交"/>
</form>
</body>
</html>
哪位眼睛好的帮忙看下,找得好蛋疼啊
这个的 name属性呢?
<input type="submit" value="提交"/>
</form>你就直接用了action的 name="LoginAction" 就玩了????
<input type="submit" value="提交"/>
</s:form>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="useraction" extends="struts-default" >
<action name="LoginAction" class="action.Actions" >
<result name="success">[color=#FF0000]/[/color]success.jsp</result>
<result name="error">/error.jsp</result>
</action>
</package>
</struts>
<result name="error">/error.jsp</result>
<body>
<form action="useraction.LoginAction" method="post">
<input type="submit" value="提交"/>
</form>
</body>应该是没有添加action包名的问题把
大哥,谁告诉你这么搞也行的。<body>
<form action="<%=request.getContextPath() + "/"%>LoginAction" method="post">
<input type="submit" value="提交"/>
</form>
</body>
要确保class的路径正确,name="LoginAction" 一般是小写的,loginAction,(这个问题不大)Actions类里要public String execute()方法
<result name="goList">/page/common/wCommon/Base_FlutePaperPosition/baseFlutePaperPositionQuery.jsp</result>
<result name="goEdit">/page/common/wCommon/Base_FlutePaperPosition/baseFlutePaperPositionEdit.jsp</result>
<result name="goAdd" >/page/common/wCommon/Base_FlutePaperPosition/baseFlutePaperPositionAdd.jsp</result>
<result name="goInfo">/page/common/wCommon/Base_FlutePaperPosition/baseFlutePaperPositionInfo.jsp</result>
</action>