Check if parameter exists in Expression Language [duplicate]
问题 This question already has answers here : Evaluate empty or null JSTL c tags (8 answers) Closed 3 years ago . <c:if test="${param.username}" > </c:if> How do I check if param.username exists?? 回答1: Use the not empty check. <c:if test="${not empty param.username}" > </c:if> Edit: If you have a parameter of the form ?username (no value), it is safer to use ${param.username ne null} 回答2: If you want to check if parameter exists, just test if it is not null, in your case: <c:if test="${param