Perform var1.contains(var2) in jsp

In jsp, performing equals or not equals is pretty simple :for equals :<%@ taglib prefix="c" uri="" %><c:if test="${var1 eq var2}">for not equals : <%@ taglib prefix="c" uri="" %><c:if test="${var1 ne var2}">To perform contains function, following snippet will be used : <%@ taglib prefix="c" uri="" %><%@ taglib prefix="fn" uri="" %><c:if test="${fn:contains(var1, 'test')}">


Make a variable in upper or lower case in jsp.

Making a variable/String in upper or lower case in java is straightforward : String str="hello"; String UpperStr=str.toLowerCase(); That is, there is an inbuilt function in java. In jsp, you can do the following : <%@ taglib prefix="fn" uri=""%> <c:set var="count" value="{(fn:toLowerCase(count.isocode)}" > And then you can use the value of count in any c:if or …

Passing a parameter from controller to jsp using Map

A parameter can be passed from controller to jsp in several number of ways.Using MAp is one of those ways . Following is the code snippet of how parameter can be passed through map : Map<String, Object> passParameter() { final Map<String, Object> responseMap = new HashMap<String, Object>(); responseMap.put("quant", 11); return responseMap; } Hello.jsp <%@ …