A quick JSTL question. I usually use scriptlets in my jsp pages, but have a conflict due to some other things in my page. I understand you can do something like this using JSTL, although I am not familiar with it. Here is what I would code using java for this:
if (var1.equalsIgnoreCase(var2)) {
some html stuff
} else {
more html
}
So can this be converted and translated to be used with JSTL?
Thanks in advance and if you have any questions, just let me know.
You can use
<c:choose>for this. TheequalsIgnoreCase()can be done by lowercasing the both sides byfn:toLowerCase().Or when you’re targeting a Servlet 3.0 container (Tomcat 7, Glassfish 3, JBoss AS 6, etc) with a
web.xmldeclared conform Servlet 3.0, then you can invoke theequalsIgnoreCase()method.