<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8" isELIgnored="false" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script>
</script>
<title>show.jsp的标题</title>
</head>
<body>
<h3>以下是搜索到的关键字:<font style = "color:red" id = "key">${key}</font></h3>
<h4>总共搜索到<span style = "color:red">${map.linkCount}</span>个链接,复合条件的链接有<span style = "color:red">${map.count}</span>个</h4>
<h5>点击<a href = "${url}"><span style = "color:red">这里</span></a>进入该页面</h5>
<ul>
<c:forEach var = "linkValue" items="${map.list}">
<script>
var lv = '${linkValue.linkValue}';
var key = '${key}';
if(lv.indexOf(key)>0){
var hightlight = '<span style = "color:red">'+lv.substring(lv.indexOf(key),(lv.indexOf(key)+key.length))+'</span>';
var headValue = lv.substring(0,lv.indexOf(key));
var lastValue = lv.substring((lv.indexOf(key)+key.length),lv.length);
document.write('<li><a href = "${linkValue.aLink}">'+headValue+hightlight+lastValue+'</a></li>');
}else{
var hightlight = '<span style = "color:red">'+lv.substring(lv.indexOf(key),key.length)+'</span>';
var lastValue = lv.substring(key.length,lv.length);
document.write('<li><a href = "${linkValue.aLink}">'+hightlight+lastValue+'</a></li>');
}
</script>
</c:forEach>
</ul>
</body>
</html>