关于使用logic:equal的问题

来源:百度知道 编辑:UC知道 时间:2024/05/29 20:39:30
<logic:equal parameter="${petInfo.petType}" value="1">
<img src="source/images/pet/pig.jpg" width="200px"height="140px" />
</logic:equal>

我可以得到petType的值,可是为什么不执行中间的那段代码呢?附:petType在数据库和代码里都是int型的就1,2,3这3个值

如果type是直接存到session中的话,直接<logic:equal name="type" value="1">就可以;如果你的type是先存到某个对象然后把对象存到session中,那就<logic:equal name="你的对象" property="type" value="1">

<logic:equal name="${petInfo.petType}" value="1">
<img src="source/images/pet/pig.jpg" width="200px"height="140px" />
</logic:equal>

我用的是name属性。你看可不可以解决