检查表达式语言中是否存在参数 [英] Check if parameter exists in Expression Language

查看:61
本文介绍了检查表达式语言中是否存在参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<c:if test="${param.username}" >
</c:if>

如何检查param.username是否存在?

How do I check if param.username exists??

推荐答案

使用not empty检查.

<c:if test="${not empty param.username}" >
</c:if>

如果您具有格式为?username的参数(无值),则使用${param.username ne null}

If you have a parameter of the form ?username (no value), it is safer to use ${param.username ne null}

这篇关于检查表达式语言中是否存在参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆