Why are the "POST" and "submit" parts of this code highlighted in a different color in my IDE?
Also the syntax highlighter here doesn\'t h
Use a backslash character to escape the double quotes like this:
<c:if test="${\"POST\".equalsIgnoreCase(pageContext.request.method) && pageContext.request.getParameter(\"submit\") !=null}">
</c:if>
Inside the <c:if>
, your test
attribute is a also a string, which is set with double quotes, and you also have "POST"
as string literal which you are using inside string as string with double quotes. So compiler understands that as end of <c:if test>
condition. In effects, you end up having a <c:if test="${">
instead of the intended one.
Replace the double quotes inside the test
attribute with single quotes like this:
<c:if test="${'POST'.equalsIgnoreCase(pageContext.request.method) && pageContext.request.getParameter('submit') != null}">
</c:if>