java - jsp页面中这个地方得到的是null,可是为什么显示null的字符串?不应该是什么都没有吗?
PHP中文网
PHP中文网 2017-04-17 17:53:57
0
4
224

item.getAccount是得到null,为什么会显示出来,不是应该是什么都没有吗?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(4)
小葫芦

el expression can solve your problem.
As for why null is displayed, I personally think it’s because of the double quotes

小葫芦

I don’t know the syntax of jsp. If you convert it to a string, it will be displayed naturally, or you can use || to judge it

PHPzhong
<%=item.getAccount() == null ? "" : item.getAccount()%>
刘奇

This is the java code written in jsp. If it is null, it will definitely be displayed as null
Shouldn’t it be done using scope${}?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!