struts2标签<s:set></s:set>的用法、原理
我的例子:
< s:if test = " ${site==1} " >< s:set name = "hPrefix" value = "'http://weibo.com/'" ></ s:set ></ s:if >
< s:elseif test = " ${site==2} " >< s:set name = "hPrefix" value = "'http://t.qq.com/'" ></ s:set ></ s:elseif >
${site}
set标签取值方式1,el表达式:
${hPrefix }
set标签取值方式2,struts标签:
< s:property value = "#hPrefix" />