⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.jsp

📁 利用JAVA语言实现
💻 JSP
字号:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312" %>
<%@ page import="com.CureData"%>
<jsp:useBean id="listEngine" class="com.ListEngine" scope="request"/>
<jsp:useBean id="cureDataManage" class="com.CureDataManage" scope="request"/>
<%
	int type = 0; //类型 0:未登陆 1:已登陆
	String userName = "";
	if(session.getAttribute("userName") != null){ //已经登陆
		userName = (String)session.getAttribute("userName");
		type = 1;
	}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML><HEAD><TITLE>中医语料库网</TITLE>
<META content=中医专题,中医,语料库,中医语料库 name=Keywords>
<META content=中医专题,中医,语料库,中医语料库 name=Description>
<LINK href="css/list_tpl.css" type=text/css rel=stylesheet>
<LINK href="css/cm_nav.css" type=text/css rel=stylesheet>
<LINK href="css/base.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.3268" name=GENERATOR></HEAD>
<!-- js for dwr -->
<script src="<%=request.getContextPath()%>/dwr/engine.js"></script>
<script src="<%=request.getContextPath()%>/dwr/util.js"></script>
<script src="<%=request.getContextPath()%>/dwr/interface/DWRUser.js"></script>

<SCRIPT src="js/alsogood.js" type=text/javascript></SCRIPT>
<SCRIPT src="js/util.js" type=text/javascript></SCRIPT>
<BODY onLoad="showDiv('<%=type%>');matchTags('reg')">
<SCRIPT language="javascript" type="text/javascript">

	function showDiv(hasLogin){
		if(hasLogin == 1){ //已登陆
			document.getElementById('loginDiv').style.display = "none";
			document.getElementById('logoutDiv').style.display = "block";
			
		}else{ //未登陆
			document.getElementById('loginDiv').style.display = "block";
			document.getElementById('logoutDiv').style.display = "none";
		}
	}
	//点击"登陆按钮"响应的事件
	function doLogin(form){
			var userName = form.userName.value;
			userName = trim(userName);
			if(userName == ""){
				alert("用户名不能为空!");
				form.userName.focus();
				form.userName.value = "";
				return;
			}
			
			var pwd = form.userPwd.value;
			pwd = trim(pwd);
			if(pwd == ""){
				alert("密码不能为空!");	
				form.userPwd.focus();
				form.userPwd.value = "";
				return;
			}	
			
			form.action = "checkUserLogin.jsp";
			form.submit();
	}
	function doLogout(){
			window.location.href = "logout.jsp";
	}
	function doSearch(form, hasLogin){
			if(hasLogin == '1'){
				var keyword = trim(form.keyword.value);
				if(keyword == ""){
					alert("搜索关键字不能为空!");	
					form.keyword.focus();
					form.keyword.value = "";
					return;
				}
				form.action = "searchResult.jsp";
				form.submit();
			}
			else
				alert("请先登陆,否则您无搜索权限!");	
	}

</SCRIPT>

<DIV class=cm_nav>
<DIV class=nav1><IMG alt=中医语料库网 src="images/cm_logo.gif"></DIV>
<DIV class=nav2></DIV>
<DIV class=nav3>
<DIV class=menu1></DIV>
<DIV class=ntext1>中医语料库,您的治疗好帮手!</DIV>
<DIV class=menu3></DIV></DIV>
<DIV class=nav4></DIV></DIV>
<DIV class=wrap>
<DIV class=con_left>
<DIV class=leftnav>
<form name="indexForm" method="post">
<div id="loginDiv">
	<DIV class=title200><SPAN class=ico3>会员登陆</SPAN></DIV>
	<div id="login">
	<div class="tb1">用户名:<input type="text" maxLength=12 name="userName" /></div>
	<div class="tb1">密&nbsp;&nbsp;码:<input type="password" maxLength=6 name="userPwd" /></div>
	<div id="reg">
	<div class="btn"><input type="button" name="loginBtn" value="登录" onClick="doLogin(indexForm)" /><a>注册</a></div>
	</div>
	</div>
</div>

<div id="logoutDiv">
	<DIV class=title200><SPAN class=ico3>欢迎信息</SPAN></DIV>
	<div id="logout">
	<div class="showWel"><span class="showName"><%=userName%>,</span>&nbsp;欢迎您!</div>
	<div class="exitLogin"><a href="javascript:doLogout()" >退出</a></div>
	</div>
</div>

<DIV class=hspace8></DIV>

<!--病症查询 开始-->
<DIV class=title200><SPAN class=ico2>病症查询</SPAN></DIV>
<div id="search">
<div class="tb1">关键字:<input type="text" maxLength=12 name="keyword" /></div>
<div class="btn"><input type="button" name="searchBtn" value="搜索" onClick="doSearch(indexForm, '<%=type%>')"/></div>
</div>
</form>
<DIV class=hspace8></DIV>
<!--病症查询 结束-->
<!--中医热点名词 开始-->
<DIV class=title200><SPAN class=ico4>中医热点名词</SPAN></DIV>
<UL>
  <LI><A>[凉茶]</A> </LI>
  <LI><A>[秋燥]</A> </LI>
  <LI><A>[周易]</A> </LI>
  <LI><A>[补血]</A> </LI></UL>
<UL>
  <LI><A>[调经]</A> </LI>
  <LI><A>[肾虚]</A> </LI>
  <LI><A>[养肾]</A> </LI>
  <LI><A>[上火]</A> </LI></UL>
<UL>
  <LI><A>[养颜]</A> </LI>
  <LI><A>[刮痧]</A> </LI>
  <LI><A>[拔罐]</A> </LI>
  <LI><A>[气虚]</A> </LI></UL>
<UL>
  <LI><A>[易经]</A> </LI>
  <LI><A>[太极]</A> </LI>
  <LI><A>[藏象]</A> </LI>
  <LI><A>[五行]</A> </LI></UL>
<UL>
  <LI><A>[壮阳]</A> </LI>
  <LI><A>[滋阴]</A> </LI>
</UL>
</DIV>
<!--中医热点名词 结束-->
</DIV>
<DIV class=con_middle>
<DIV class=location><a>常见病例与治疗方法</a></DIV>
<DIV class=newslist>

<%
  /* 每5条记录的HTML代码如下:
   <UL>
  	<LI><A href="#" target="_blank"></A></LI>
  	<LI class=date target="_blank">2007-11-18</LI>
  	<LI><A href="#" target="_blank"></A></LI>
  	<LI class=date target="_blank">2007-11-10</LI>
  	<LI><A href="#" target="_blank"></A></LI>
  	<LI class=date target="_blank">2007-11-7</LI>
  	<LI><A href="#" target="_blank"></A></LI>
  	<LI class=date>2007-10-18</LI>
  	<LI><A href="#" target="_blank"></A></LI>
  	<LI class=date>2007-9-5</LI>
  </UL>
  <DIV class=line></DIV>*/
  
	List<CureData> list = listEngine.getCureDataList("");
	CureData cureData = null;
	for(int i = 0;i < list.size();i++){
		if(i > 14)
			break; //最多只显示15条记录
			
		try{
			cureData = (CureData)list.get(i);
		}catch(Exception e){
			break;	
		}
		String innerHtml = "<LI><A href=\"showData.jsp?id=" + String.valueOf(cureData.getId()) + "\" target=\"_blank\">" + cureData.getSymptom() + "</A></LI>";
		innerHtml += " <LI class=date>" + cureData.getAddDate().split(" ")[0] + "</LI>";
		
		if(i == 0){
			out.println("<UL>");
			out.println(innerHtml);	
			
		}else if(i > 0 && i < 4){
			out.println(innerHtml);
		
		}else if(i == 4){
			out.println(innerHtml);
			out.println("</UL><DIV class=line></DIV><UL>");
			
		}else if(i > 4 && i < 9){
			out.println(innerHtml);
		
		}else if(i == 9){
			out.println(innerHtml);
			out.println("</UL><DIV class=line></DIV><UL>");
		
		}else if(i > 9 && i < 14){
			out.println(innerHtml);
			
		}else if(i == 14){
			out.println("</UL><DIV class=line></DIV>");
		}
	}
%>
</DIV>
</DIV>

<DIV id=bottominfo>中医语料库网 Copyright &copy; 2008-2018 | <a href="adminLogin.jsp" target="_blank">后台管理</a></DIV>

</BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -