📄 searchnewsresult.jsp
字号:
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.io.*" %>
<%@ page import="org.imagegrid.newsinfo.*" %>
<%@ page import="org.w3c.dom.*" %>
<%@ page import="javax.xml.parsers.*" %>
<%@ page import="java.util.regex.*" %>
<%@ page language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><!-- InstanceBegin template="/Templates/news.dwt.jsp" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>图像处理重点学科网格</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
TD {font-family:"宋体";font-size:11;}
.textLC {font-family:"宋体";font-size:10;color:#000000;padding-right:10px;padding-top:10px;font:900;}
.textL {font-family:"宋体";font-size:10;color:#000B8D;padding-right:10px;}
.textRC {font-family:"宋体";font-size:11;color:#00CE39;padding-right:10px;padding-top:5px;font:900;}
.copy {font-family:"宋体";font-size:10;color:#FFFFFF;}
.STYLE8 {font-family: "宋体";font-size: 13px}
.STYLE10 {
font-family: "宋体";
font-size: 23px;
color: #3333FF;
}
.STYLE20 {font-family: "宋体";font-size: 18px; color: #0066FF; font-weight: bold; }
.STYLE39 {font-family: "宋体";color: #000000; font-size: 18px; }
.STYLE42 {font-family: "宋体";font-weight: bold}
.STYLE6 {color: #6633CC; font-family: "方正舒体"; font-size: 18px; font-weight: bold; }
</style>
</head>
<body topmargin="0">
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="91%" align="center">
<!--上边的图片-->
<tr>
<td height="188" colspan="2" valign="top" background="images/mainN.jpg"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="449" rowspan="2" valign="top"><img src="images/main1.jpg" width="449" height="188" border="0" /></td>
<td width="294" valign="top"><img src="images/main2.jpg" width="293" height="139" border="0" /></td>
</tr>
<tr>
<td valign="top"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><img src="images/main3.jpg" width="88" height="49" border="0" /></td>
<td valign="top" background="images/main4bg.jpg" width="205" height="49"> </td>
</tr>
</table></td>
</tr>
</table></td>
<td background="images/mainN.jpg"></td>
</tr>
<!--上边的图片结束-->
<!--导航栏-->
<tr>
<td valign="top" colspan="2" background="images/menuN.jpg">
<%
String ID1=session.getValue("id").toString();
if(!ID1.equals("null"))
{%>
<a href="index2.jsp" >
<%
}else{
%>
<a href="index1.jsp" >
<%
}
%>
<img src="images/menu1.jpg" width="66" height="25" border="0"></a><a href="newsshow1.jsp"><img src="images/menu2.jpg" width="74" height="25" border="0"></a><a href="resource.jsp"><img src="images/menu3.jpg" width="75" height="25" border="0"></a>
<%
String ID=session.getValue("id").toString();
if(!ID.equals("null"))
{%>
<a href="virtuallib.jsp" ><img src="images/menu11.jpg" width="96" height="25" border="0" /></a><a href="service.jsp" >
<img src="images/menu4.jpg" width="73" height="25" border="0"></a>
<a href="numb1bbsa/bbs/index.jsp" target="_blank">
<img src="images/menu5.jpg" width="73" height="25" border="0"></a>
<a href="monitor/000.html" >
<img src="images/menu10.jpg" width="73" height="25" border="0"></a>
<%
}else{
%>
<a href="virtuallib1.jsp" >
<img src="images/menu11.jpg" width="85" height="25" border="0"></a>
<a href="service1.jsp" >
<img src="images/menu4.jpg" width="73" height="25" border="0"></a>
<a href="numb1bbsa/bbs/index.jsp" target="_blank">
<img src="images/menu5.jpg" width="73" height="25" border="0"></a>
<a href="monitor1.jsp" >
<img src="images/menu10.jpg" width="73" height="25" border="0"></a>
<%
}
%> <a href="admin_login.jsp"><img src="images/menu9.jpg" width="73" height="25" border="0"></a> <img src="images/spacer.gif" height="1" width="230" /><a href=""></a><a href=""></a><a href=""></a> </td>
<td background="images/menuN.jpg"></td>
</tr>
<!--导航栏结束-->
<!--中间部分-->
<tr>
<!--左边的登陆链接等-->
<td width="22%" height="100%" valign="top" ><table width="195" height="544" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="195" height="29" valign="top"><img src="images/cap1.jpg" width="194" height="29" border="0"></td>
</tr>
<tr>
<td height="337" align="left" valign="top" background="images/bgL.jpg" style="padding-left:10px;"><table width="97%" border="0" cellpadding="0" cellspacing="0" bordercolor="#999999">
<tr>
<td valign="middle" scope="col"><div align="right"><span class="STYLE20"><a href="newsshow1.jsp" target="_top">业内新闻</a> </span><a href="newsshow1.jsp"><img src="images/more1.jpg" width="21" height="24" border="0" /></a>
<hr />
</div></td>
</tr>
<tr>
<td valign="middle"><div align="right"><span class="STYLE20"><a href="newsshow2.jsp" target="_top">研究动向</a> </span><a href="newsshow2.jsp"><img src="images/more1.jpg" width="21" height="24" border="0" /></a>
<hr />
</div></td>
</tr>
<tr>
<td valign="middle"><div align="right"><span class="STYLE20"><a href="newsshow3.jsp" target="_top">网格新闻</a></span> <a href="newsshow3.jsp"><img src="images/more1.jpg" width="21" height="24" border="0" /></a>
<hr />
</div></td>
</tr>
<tr>
<td valign="middle"><div align="right"><span class="STYLE20"><a href="newsshow4.jsp" target="_top">会议通知</a> </span><a href="newsshow4.jsp"><img src="images/more1.jpg" width="21" height="24" border="0" /></a>
<hr />
</div></td>
</tr>
</table>
<br />
<div align="center"><span class="STYLE39"><span class="STYLE6"><img src="images/other1.gif" width="32" height="32" /></span> <a href="monitor/000.html" target="_blank"><strong>平台监测>></strong></a></span><span class="STYLE10"><br>
<span class="STYLE39"> <span class="STYLE6"><img src="images/others4.gif" width="32" height="32" /></span> <a href="service.jsp" target="_blank"><strong>典型应用>></strong></a></span></span><br />
<span class="STYLE39"><span class="STYLE6"><img src="images/others3.gif" width="32" height="32" /></span> <a href="virtuallib.jsp" target="_blank"><strong>虚拟实验室>></strong></a></span></div>
<br /></td>
</tr>
<tr>
<td valign="top" height="178" background="images/bgLN.gif"><p align="center"><img src="images/link1.gif" width="88" height="31"><br>
<br>
<a href="http://www.chinagrid.edu.cn/chinagrid/index.jsp" target="_blank">中国教育科研网格</a><br>
<a href="http://www.hust.edu.cn" target="_blank">华中科技大学</a><br>
<a href="http://www.china-image.cn" target="_blank">中国图像网</a><br>
<a href="http://www.csig.org.cn/" target="_blank">中国图像图形学学会</a></p> </td>
</tr>
</table> </td>
<!--左边的登陆链接等结束-->
<!--右边的新闻显示-->
<td width="78%" height="100%" valign="top"><table width="100%" height="543" border="0" cellpadding="0" cellspacing="0" bgcolor="#E9F6FA">
<tr>
<td height="543" valign="top" scope="col"><div align="left"><br />
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="26%" scope="col"><img src="images/news.gif" width="168" height="56" /></td>
<td width="28%" scope="col" ><!-- InstanceBeginEditable name="EditRegion3" --><!-- InstanceEndEditable --></td>
<td width="46%" scope="col"><!-- InstanceBeginEditable name="EditRegion5" --><!-- InstanceEndEditable --> </td>
</tr>
</table>
</div>
<!-- InstanceBeginEditable name="EditRegion4" -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">
<%
response.setContentType("text/html;charset=gbk");
request.setCharacterEncoding("gbk");
String content=request.getParameter("content");
content.trim();
int n;
n=content.length();
if(n==0){
%>
</div>
<p align="center"><b><font color="#FF33FF" face="宋体" size="+2">您的输入有误,输入不能为空!</font></b></p>
<P align="center"> <b> <font color="#FF99CC" face="宋体" size="+1"><a href="SearchNews.jsp"></a></font></b></P>
<div align="center">
<%}
else{
Class.forName("com.mysql.jdbc.Driver").newInstance();
String url="jdbc:mysql://localhost/ipks?useUnicode=true&characterEncoding=gbk";
String user="imagegrid";
String password="imagegrid";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql="select * from news";
ResultSet rs=stmt.executeQuery(sql);
int intRowCount;
rs.last();
int i=0;
String buf;
boolean flag=false;
String temp=new String();
%><p align="left"><b><font color="#FF33FF" face="宋体" size="+2">搜索结果:</font></b></p>
<%
int j;
int k;
boolean flag1;
String regEx="(\\w|\\d)";
Pattern p=Pattern.compile(regEx);
Matcher m=p.matcher(content);
if(m.find()){
content=content.toLowerCase();
//out.println(content.toLowerCase());
while(!rs.isBeforeFirst()){
buf=rs.getString("news_title");
buf=buf.toLowerCase();
// out.println(buf.toLowerCase());
Pattern pp=Pattern.compile("(\\b|\\()"+content+"(\\d|\\b|\\))");
Matcher mm=pp.matcher(buf);
if(mm.find()){
flag=true;
%>
</div>
<tr>
<td width="69%" height="22">
<div align="left" style="font:'宋体'"><a href="ynnews1.jsp?id=<%=rs.getString("news_id")%>" class="STYLE35"><%=i+1%>.</a><a href="ynnews1.jsp?id=<%=rs.getString("news_id")%>" class="STYLE35"><%=rs.getString("news_title")%></a></div>
</td>
<td width="31%">
<div align="center" style="font:'宋体'"><%=rs.getString("news_date")%></div>
</td>
</tr>
<div align="center">
<%
}
i++;
rs.previous();
}
rs.close();
}
else{
// out.println(content);
while(!rs.isBeforeFirst()){
buf=rs.getString("news_title");
temp=buf.replaceFirst(content,"");
if(temp.length() < buf.length()){
flag=true;
%>
</div>
<tr>
<td width="69%" height="22">
<div align="left" style="font:'宋体'"><a href="ynnews1.jsp?id=<%=rs.getString("news_id")%>" class="STYLE35"><%=i+1%>.</a><a href="ynnews1.jsp?id=<%=rs.getString("news_id")%>" class="STYLE35"><%=rs.getString("news_title")%></a></div>
</td>
<td width="31%">
<div align="center" style="font:'宋体'"><%=rs.getString("news_date")%></div>
</td>
</tr>
<div align="center">
<%i++;
}
rs.previous();
}
rs.close();
}
stmt.close();
conn.close();
if(flag==false){
%>
</div>
<tr>
<td colspan="2">
<p align="center"><b><font color="#000000" face="宋体" size="+2">抱歉,没有找到与 "<font color="#FF33CC" face="宋体" ><%=content%></font>" 相关的新闻</font></b></p>
<%
}
else{%>
</div>
<%
String k1=request.getParameter("id");
//out.println(k1);
%>
<tr>
<td colspan="2">
<%
if(k1.equals("1")||k1.equals("20")||k1.equals("10")){%>
<p align="center"><b><a href="newsshow1.jsp">返回</a></b></p>
<%}%>
<%
if(k1.equals("2")||k1.equals("21")){%>
<p align="center"><b><a href="newsshow2.jsp">返回</a></b></p>
<%}%>
<%
if(k1.equals("3")||k1.equals("22")){%>
<p align="center"><b><a href="newsshow3.jsp">返回</a></b></p>
<%}%>
<%
if(k1.equals("4")||k1.equals("23")){%>
<p align="center"><b><a href="newsshow4.jsp">返回</a></b></p>
<%}%>
<% }
}
%> </td>
</tr>
</table>
<!-- InstanceEndEditable --> </tr>
</table>
<!--右边的新闻显示结束--></td>
<!--中间部分结束-->
</tr>
<!--底部的版权信息 -->
<tr>
<td valign="middle" colspan="2" height="43" background="images/bgbot.jpg" align="center"><span class="STYLE8"> 华中科技大学图像处理重点学科网格</span></td>
<td background="images/botN.jpg" width="0%"></td>
</tr>
<!--底部的版权信息结束 -->
</table>
</body>
<!-- InstanceEnd --></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -