struts2還有人用嗎 struts2 Action屬性值?
struts2 Action屬性值?在Struts2中,action屬性用來(lái)封裝請(qǐng)求參數(shù),可以是普通屬性,也可以是對(duì)象模型。不管怎樣,問題是:如何分配屬性的值?調(diào)查方法可以在操作中添加一個(gè)簡(jiǎn)單的屬性來(lái)
struts2 Action屬性值?
在Struts2中,action屬性用來(lái)封裝請(qǐng)求參數(shù),可以是普通屬性,也可以是對(duì)象模型。不管怎樣,問題是:如何分配屬性的值?調(diào)查方法可以在操作中添加一個(gè)簡(jiǎn)單的屬性來(lái)生成getter setter方法,并在setter方法中添加斷點(diǎn)來(lái)跟蹤。操作代碼如下:
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){這個(gè)名字=Name//add breakpoints to the line to debug and run Tomcat]}