struts2配置文件的struts。xml熟悉的进来下

来源:百度知道 编辑:UC知道 时间:2024/06/14 22:20:21
<action name="Login" class="action.Login" method="">

那个method参数是干什么的?说明白点

method="在action.Login类中的某一个返回字符串的方法"

当接到请求时会自动转发到该方法,由该方法进行处理

例如:
public class LoginAction extends ActionSupport{
public String doLogin(){
//对请求进行处理
}
}

在配置中可以这样写:
<action name="Login" class="LoginAction" method="doLogin">

method就是你相应action里面的函数名称。
<action name="Login" class="action.Login" method="调用哪个函数">