基于lunece小型局域网搜索引擎,在java中已能搜索到结果数组hc,现想用jsp实现用户界面,没有头绪,请高物给点意见~~
解决方案 »
- 求解:jsp问题
- 请问,<display>在一个页面里加两个可以吗?
- 在spring MVC框架下,如何在启动tomcat的时候拉起一部分代码。
- 请教个小问题 <textarea disabled rows="5">ABCDE</textarea> 能改变ABCDE的颜色么?
- 分页显示的跳转代码怎么写?
- 高分求简单问题(数据库访问)
- 动态传参
- 高手快帮帮我....,网站被攻击,现在打不开,怎样防止别人攻击???
- JAVABEAN调用存储过程的方法怎么写,带有多个返回值的?JSP里如何调用?
- 关于java将xml+xsl整合的,帮我看看为什么会出错,好吗?
- java是如何与硬件交互的且是客户端访问
- jbpm4.3与spring集成后发布问题
。想写action 也行。
<%
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="" > <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>
想在整个jsp中都能用,在哪定义!jsp刚接触,高手们给看看,不甚感激~~
就像这样