基于lunece小型局域网搜索引擎,在java中已能搜索到结果数组hc,现想用jsp实现用户界面,没有头绪,请高物给点意见~~

解决方案 »

  1.   

    ....结果都拿到了,前端页面不会搞?ajax。ok?
      

  2.   

    把jquery的库引用进去、直接调就是了。。写html不就好了
    。想写action 也行。
      

  3.   

    <%@ page language="java" import="java.util.*,xin.*" pageEncoding="GBK"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <%
     Searchinsite searchinsite;//定义不起作用
     int x=0;
     int nown;
     %>
      <head>
      <title>test</title>
    <script type="text/javascript">
    function fun(int n){
    x=1;
    var Input = document.getElementById('Input').value;//???
    String str=request.getParameter("Input"); 
    searchinsite=new Searchinsite(str,n);
    }

    function huanye(int a){
    nown=searchinsite.getN();
            searchinsite.pageBean(a,nown,numTotalHits);
    }


    </script>
        <base href="<%=basePath%>">
        
        <title>My JSP 'Jsp1.jsp' starting page</title>
        
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->  </head>
      
      <body>
      <div align="center"><font color="#800000" face="华文琥珀" size="7"><strong>局域网内搜索引擎</strong></font><font size="4"><br><br></font></div>
      <div align="center"><input type="text" id="Input" value="" >&nbsp;<input type="button" onClick="fun(1)" name="command1" value="搜索"> <br><br></div>
      <div align="center"><input type="checkbox" name="select" value="0" checked>jpg
       <input type="checkbox" name="select" value="1">txt
       <input type="checkbox" name="select" value="2">doc</div>
       
    <%if(x==1){%>
    一共所搜到<%=searchinsite.getnumTotalHits()%>条//报错,无法显示
    <table width="1129" height="52"><tr><td></td></tr>
    <tr>
    <td><center>
    <input type="button" onClick="huanye(1)" name="commandshou" value="首页">
    <input type="button" onClick="huanye(2)" name="commandshang" value="上一页">
    <input type="button" onClick="huanye(3)" name="commandxia" value="下一页">
    <input type="button" onClick="huanye(4)" name="commandwei" value="尾页">
    </center>
    </td>
    </tr>
    </table>
       
      </body>
      
     
    </html>
      

  4.   

    searchinsite=new Searchinsite(str,n);
    想在整个jsp中都能用,在哪定义!jsp刚接触,高手们给看看,不甚感激~~
      

  5.   

    <%@ page import="com.cs.model.server.bean.Task" %>
    就像这样