struts2前端 jsp页面 展示内容各种格式汇总
在新公司维护系统,系统是使用struts2 +jsp 开发,刚开始不熟知,返回数据展示问题搞得头大,if:test标签有时候返回字段需要加引号有时又不用,有时候还要#号,搞得我都晕坨坨,现根据查询的文章进行总结一下
二、if:test汇总
1.判断单个字符
<s:if test=“resultMap.username==‘c’.toString()”>
2.判断为数字
<s:if test=“resultMap.ctltyp ==1” >
3.判断为字符串
<s:if test=‘cusmoenv==“M5” or cusmoenv==“MA”’>
其中如果数据是action 段传递过来的不需要家#,如果不是需要加#
<s:property value=“#resultMap.unsualMO” />
参考连接
https://blog.csdn.net/phantomes/article/details/84384932