如何检查EL变量的类型?我想在变量上运行map.loadImage('https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Cat_silhouette.svg/400px-Cat_silhouette.svg.png', (error, image) => {
if (error) throw error;
map.addImage('cat', image);
map.addLayer({
"id": "points",
"type": "symbol",
"source": {
"type": "geojson",
"data": {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [0, 0]
}
}]
}
},
"layout": {
"icon-image": "cat",
"icon-size": 0.25
}
});
});
方法,如下所示:
indexOf
但我注意到的是,如果“par.key”不是字符串,我会收到以下错误
<c:forEach items="${requestScope}" var="par">
<c:if test="${par.key.indexOf("_") != 0}">
..
</c:forEach>
上面编写JSP代码段的更准确的方法是什么?
答案 0 :(得分:0)
您需要通过toString()
将对象转换为字符串。
<c:forEach items="${requestScope.keySet()}" var="key">
<c:if test='${key.toString().indexOf("_") != 0}'>
..
</c:forEach>