%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <% request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String currentQuery=(String) request.getAttribute("currentQuery"); int currentPage=(Integer) request.getAttribute("currentPage"); String[] titles=(String[]) request.getAttribute("titles"); String[] urlPaths=(String[]) request.getAttribute("urls"); String[] contents = (String[]) request.getAttribute("contents"); int totalNum = Integer.parseInt(request.getAttribute("totalNum").toString()); long times = Long.parseLong(request.getAttribute("times").toString()); String suggest = (String)request.getAttribute("suggest"); String[] recommendation = (String[])request.getAttribute("recommendation"); System.out.println("totalNum="+request.getAttribute("totalNum")); %>
您要找的是不是: <%=suggest%>
<%}%>
为您推荐
<%for(int i=0;i<10;i++){if(recommendation[i]!=null){%>
<%=String.valueOf(i + 1) + " " + recommendation[i]%>
<%}}%>