Struts2用Action属性接收参数报错

这个项目报错如下: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;
    }


}


请问是什么问题,怎么解决?


查看全部
hoho_12
hoho_12
2016/01/14 07:38
  • struts
  • action
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

4个回复