I have a two variable in jsp page with the following value--
String name1="Zenith&Swang^&^John&Ban^&^Philip";
String name2="Zenith^&^Java^&^PHP";
I need to split the above string using this string => ^&^
, I can't use the jstl version of split since it split the string by checking the charcter of string, not the whole string.I need to use the split function of core java, which solve my problem, but I am unable to use that inside jstl tag like below:
<c:if test="${name1.split("\\^\\&\\^")[0]==name2.split("\\^\\&\\^")[2]}">
<input type="hidden" value = "${name1.split("\\^\\&\\^")[0]}" name="name1" />
Above two line in jsp showing error, because of using double quote inside split function, showing unterminated <c:if
tag.
I have already using <% >
tag, its working. So Its my request to not give solution using default jsp tag <%! >
<%>