struts2還有人用嗎 struts2 Action屬性值?
struts2 Action屬性值?在Struts2中,action屬性用來封裝請求參數(shù),可以是普通屬性,也可以是對象模型。不管怎樣,問題是:如何分配屬性的值?調(diào)查方法可以在操作中添加一個簡單的屬性來
struts2 Action屬性值?
在Struts2中,action屬性用來封裝請求參數(shù),可以是普通屬性,也可以是對象模型。不管怎樣,問題是:如何分配屬性的值?調(diào)查方法可以在操作中添加一個簡單的屬性來生成getter setter方法,并在setter方法中添加斷點(diǎn)來跟蹤。操作代碼如下:
public class useraction{
private string name
public useraction(){系統(tǒng)輸出打?。ā?=create useraction object=”)
}]公共字符串execute(){系統(tǒng)輸出打?。ā眻?zhí)行方法。。。")
系統(tǒng)輸出打?。ā皀ame========”name)
return“success”
}
public String getName(){
return name
}
public void setName(String name){這個名字=Name//add breakpoints to the line to debug and run Tomcat]}