There are Fn:contains (STR,STR) methods in Jstl to determine whether a string contains another string, but there is no way to tell if the list contains string, so you write a method yourself
Contains.tag:
<%@ tag import= "java.util.List"%>
<%@ tag import= "Org.apache.commons.lang3.StringUtils"%>
< %@ tag import= "java.util.Arrays"%>
<% @tag pageencoding= "UTF-8"%> <%@
attribute name= "Srcstr" Type= "Java.lang.String" required= "true"%>
<%@ attribute name= "Separatorchars" type= "java.lang.String" Required= "false"%>
<%@ attribute name= "str" type= "java.lang.String" required= "true"%>
String sepchars=separatorchars==null? " -": Separatorchars;
string[] Splitchars = Stringutils.split (Srcstr, sepchars);
list<string> list = Arrays.aslist (splitchars);
if (List.contains (str))
{%>
<jsp:doBody/>
<%}
%>
Then add a sentence to the page of the method you want to use:
<%@ taglib prefix= "gms" tagdir= "/web-inf/tags"%>
So you can use it directly
<gms:contains srcstr= "${srcstr}" str= "${str}" > str </gms:contains>
That's the way to judge.
The above is small series for everyone to bring the JSP to determine whether the list contains a string of the implementation of all the content, I hope that we support cloud-Habitat Community ~