為什么我登陸login.jsp界面后提交出現(xiàn)404
package com.tz.jsd1511.action;
import com.opensymphony.xwork2.ActionSupport;
public class LoginAction extends ActionSupport{
?? ?private String username;
?? ?private String password;
?? ?
?? ?
?? ?
?? ?public String execute(){
?? ??? ?System.out.println(username);
?? ??? ?
?? ??? ?return "success";
?? ?}
?? ?public String getUsername() {
?? ??? ?return username;
?? ?}
?? ?public void setUsername(String username) {
?? ??? ?this.username = username;
?? ?}
?? ?public String getPassword() {
?? ??? ?return password;
?? ?}
?? ?public void setPassword(String password) {
?? ??? ?this.password = password;
?? ?}
?? ?
?? ?
}
----------------------------------------------------------------------------------------------
??? <package name="another" namespace="/" extends="struts-default">
?? ??? ?<action name="redirectA" class="com.tz.jsd1511.action.Helloworld" method="execute">
?? ??? ??? ?<result name="success" type="redirectAction"? >
?? ??? ??? ??? ?<param name="actionName">helloworld</param>
?? ??? ??? ??? ?<param name="namespace">/hello</param>
?? ??? ??? ?</result>
?? ??? ?</action>
?? ??? ?
?? ??? ?
?? ??? ?<action name="login" class="com.tz.jsd1511.action.LoginAction" method="execute">
?? ??? ??? ?<result>/jsp/success.jsp</result>
?? ??? ?</action>
?? ??? ?
?? ??? ?<action name="insertvalue" class="com.tz.jsd1511.action.InsertValue" method="execute">
?? ??? ??? ?<param name="insert">/images</param>
?? ??? ??? ?<result name="success">/jsp/insertvalue.jsp</result>
?? ??? ?</action>
?? ?</package>
</struts>
2017-09-12
過濾器 /*?
2016-08-01
看看是不是后綴名沒有改回.action
2016-05-01
改完之后將Servers下的部署生成的文件刪掉之后重新部署試一下
2016-03-09
There is no Action mapped for namespace [/jsp] and action name [LoginAction] associated with context path [/Struts2_01]
改了半天沒反應(yīng)