struts2还有人用吗 struts2 Action属性值?

struts2 Action属性值?在Struts2中,action属性用来封装请求参数,可以是普通属性,也可以是对象模型。不管怎样,问题是:如何分配属性的值?调查方法可以在操作中添加一个简单的属性来

struts2 Action属性值?

在Struts2中,action属性用来封装请求参数,可以是普通属性,也可以是对象模型。不管怎样,问题是:如何分配属性的值?调查方法可以在操作中添加一个简单的属性来生成getter setter方法,并在setter方法中添加断点来跟踪。操作代码如下:

public class useraction{

private string name

public useraction(){系统输出打印(“==create useraction object=”)

}]公共字符串execute(){系统输出打印(”执行方法。。。")

系统输出打印(“name========”name)

return“success”

}

public String getName(){

return name

}

public void setName(String name){这个名字=Name//add breakpoints to the line to debug and run Tomcat]}