這個項目報錯如下:There is no Action mapped for namespace [/] and action name [user!add] associated with context path [/input].
struts.xml的配置如下:
UserAction.java文件
package com.wxh.action;
import com.opensymphony.xwork2.ActionSupport;
public class UserAction extends ActionSupport {
/**
*
*/
private static final long serialVersionUID = 1L;
private String name;
private int age;
public String add(){
System.out.println("name="+name);
System.out.println("age="+age);
return SUCCESS;
}
public String getName(){
return name;
}
public void setName(String name){
this.name=name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
請問是什麼問題,怎麼解決?
問題解決了,在struts.xml中加入這一句就行了。