慕移动1472919
2016-03-09 22:53
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>
过滤器 /*
看看是不是后缀名没有改回.action
改完之后将Servers下的部署生成的文件删掉之后重新部署试一下
There is no Action mapped for namespace [/jsp] and action name [LoginAction] associated with context path [/Struts2_01]
改了半天没反应
Struts2入门
95061 学习 · 456 问题
相似问题