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

📄

📁 一些jsp源代码 内含完整jsp程序 希望大家喜欢!!!!!!!!!!!!!!!!!!!1
💻
字号:
001	<%@page contentType="text/html;charset=Gb2312" 
002	  import="Java.sql.*,Java.util.Date"%>
003	<JSP:useBean id="pool" scope="application" class="com.PoolBean"/>
004	<%
005	String strLoginUser = (String)session.getAttribute("LoginUser");
006	if (strLoginUser == null || strLoginUser.length() == 0)	
007		response.sendRedirect("Login.jsp");	
008	%>
009	<html>
010	<head>
011	  <title>用户参加会议</title>
012	<LINK REL="stylesheet" HREF="littleproject.css" TYPE="text/css">
013	<SCRIPT LANGUAGE="JavaScript" SRC=" meeting.js"></SCRIPT>
014	<script language="JavaScript" type="text/Javascript">
015	<!--
016	function isok(theform)
017	{
018	  var getformyear;
019	      getformyear= theform.arrive_year.value; 	
020	  var int_year= isintnumber(getformyear);  
021	  if (!int_year)
022	  {
023		    alert("您填入的到达日期中的年有错误!");
024			return false;
025	  } 
026	  var int_year_len=getformyear.length;
027	  if(int_year_len!=4)
028	  {
029	      alert("您填入的到达日期中的年是四位数!");
030			return false;     
031	  }
032	  var getformmonth;
033	     getformmonth = theform.arrive_month.value;
034	  var getformday;
035	     getformday = theform.arrive_day.value; 
036	  var subreturndate;
037	  subreturndate=0; 
038	  subreturndate = isrightdate(getformyear,getformmonth,getformday);
039	  if (subreturndate == 1)
040	  {
041	     alert(getformyear+"年"+getformmonth+"月只有三十天,
042                请您重新填写到达日期!");
043		 return false;
044	  }
045	  if (subreturndate == 2)
046	  {
047	     alert(getformyear+"年二月只有29天,请您重新填写到达日期!");
048		 return false;
049	  }
050	  if (subreturndate == 3)
051	  {
052	     alert(getformyear+"年二月只有28天,请您重新填写到达日期!");
053		 return false;
054	  } 
055	  if (theform.arrive_byway.value=="") 
056	  {
057		    alert("请您填写好到达的方式,便于接站!");
058		    theform.arrive_byway.focus();
059		    return (false);
060	  }
061	  var getformyear_leave;
062	      getformyear_leave= theform.leave_year.value; 	
063	  var int_year_leave= isintnumber(getformyear_leave);  
064	  if (!int_year_leave)
065	  {
066		    alert("您填入的返回日期中的年有错误!");
067			return false;
068	  } 
069	  var int_year_len_leave=getformyear_leave.length;
070	  if(int_year_len_leave!=4)
071	  {
072	      alert("您填入的返回日期中的年是四位数!");
073			return false;     
074	  }
075	  var getformmonth_leave;
076	     getformmonth_leave = theform.leave_month.value;
077	  var getformday_leave;
078	     getformday_leave = theform.leave_day.value; 
079	  var subreturndate_leave;
080	  subreturndate_leave=0; 
081	  subreturndate_leave =
082     isrightdate(getformyear_leave,getformmonth_leave,getformday_leave);
083	  if (subreturndate_leave == 1)
084	  {
085	     alert(getformyear_leave+"年"+getformmonth_leave+"月只有三十天,
086            请您重新填写返回日期!");
087		 return false;
088	  }
089	  if (subreturndate_leave == 2)
090	  {
091	     alert(getformyear+"年二月只有29天,请您重新填写返回日期!");
092		 return false;
093	  }
094	  if (subreturndate == 3)
095	  {
096	     alert(getformyear_leave+"年二月只有28天,请您重新填写返回日期!");
097		 return false;
098	  }
099	  if (theform.leave_byway.value=="") 
100	  {
101		    alert("请您填写返回方式,便于提前订票!");
102		    theform.leave_byway.focus();
103		    return (false);
104	  }
105	  if (theform.leave_destination.value=="") 
106	  {
107		    alert("请您填写返回的目的地!");
108		    theform.leave_destination.focus();
109		    return (false);
110	   }
111	return (true); 	 
112	}
113	function onClick()
114	{ 
115		this.location.replace("default.jsp");
116	}
117	-->
118	</script>
119	</head>
120	<BODY bgcolor=LightBlue>
121	<%
122	Date date = new Date();
123	String num = request.getParameter("num");
124	String meeting_title = request.getParameter("title");
125	String user_code="";
126	String user_name="";
127	String user_address="";
128	String user_tel="";
129	String user_sex="";
130	String user_duty="";
131	String user_email="";
132	try
133	{
134	    if (pool.getConnectionSize() == 0)
135		{
136			pool.initializePool();
137		}	
138		Connection con = null;
139		Statement stmt = null;	
140		ResultSet  rs=null;
141		con = pool.getConnection();
142		stmt= con.createStatement();    
143		if (strLoginUser != null && strLoginUser.length() != 0)
144		{
145		   String sql="select name,address,telephone,sex,duty,code,email from
146            user where code ='"+strLoginUser+"'";
147		   rs = stmt.executeQuery(sql);
148		   if(rs.next())
149		   {
150		      user_name=rs.getString("name");
151			  user_address=rs.getString("address");
152			  user_tel=rs.getString("telephone");
153			  user_sex=rs.getString("sex");
154			  user_duty=rs.getString("duty");
155			  user_code=rs.getString("code");
156			  user_email=rs.getString("email");
157		   }
158		}
159	%>
160	<br><br><br>
161	<center>
162	<font size=5 face="隶书"><%=meeting_title%>会议注册处</font>
163	<br>
164	<font color=red>欢迎你:<%=user_name%></font>
165	<form action="checkin_meeting_ext.jsp?num=<%=num%>"
166       method=POST onsubmit="return isok(this)">
167	<input type="hidden" name="user_name" value="<%=user_name%>">
168	<input type="hidden" name="user_address" value="<%=user_address%>">
169	<input type="hidden" name="user_tel" value="<%=user_tel%>">
170	<input type="hidden" name="user_sex" value="<%=user_sex%>">
171	<input type="hidden" name="user_duty" value="<%=user_duty%>">
172	<input type="hidden" name="user_code" value="<%=user_code%>">
173	<input type="hidden" name="user_email" value="<%=user_email%>">
174	<TABLE border=1 bordercolor=RoyalBlue bgcolor=LightBlue width=400>
175	  <tr>
176	    <TD width=150 align=center>到达日期</TD>
177		<TD width=250 align=left>
178		 <input type="text" size="10" name="arrive_year"
179         maxlength="4" style="border-style: solid; border-width: 1">年
180		 <select name="arrive_month" size="1">	
181			  
182               
183             	    
184			  <%
185			  for (int i=0; i<10;i++)
186			  {
187	          %>
188			     <option value="0<%=i+1%>"><%=i+1%></option>
189	          <%
190	          }
191			  for (int i=10; i<12;i++)
192			  {
193	          %>
194			     <option value="<%=i+1%>"><%=i+1%></option>
195	          <%
196	          }
197	          %>
198	       </select>月
199		   <select name="arrive_day" size="1">		 
200			  
201			  <%
202			  for (int j=1; j<10;j++)
203			  {
204	          %>
205			     <option value="0<%=j%>"><%=j%></option>
206	          <%
207	          }
208			  for (int j=10; j<32;j++)
209			  {
210	          %>
211			     <option value="<%=j%>"><%=j%></option>
212	          <%
213	          }
214	          %>
215	       </select>日
216		</TD>
217	  </tr>
218	  <tr>
219	    <TD width=150 align=center>到达方式</TD>
220		<TD width=250 align=left>
221		 <input type="text" size="34" name="arrive_byway"
222          style="border-style: solid; border-width: 1">
223		</TD>
224	  </tr>
225	  <tr>
226		<TD width=150 align=center>返回日期</TD>
227		<TD width=250 align=left>
228		  <input type="text" size="10" maxlength="4" name="leave_year"
229               style="border-style: solid; border-width: 1">年
230		  <select name="leave_month" size="1">	
231			 
232    
233             	    
234			  <%
235			  for (int i=0; i<10;i++)
236			  {
237	          %>
238			     <option value="0<%=i+1%>"><%=i+1%></option>
239	          <%
240	          }
241			  for (int i=10; i<12;i++)
242			  {
243	          %>
244			     <option value="<%=i+1%>"><%=i+1%></option>
245	          <%
246	          }
247	          %>
248	       </select>月
249		   <select name="leave_day" size="1">		 
250			  
251			  <%
252			  for (int j=1; j<10;j++)
253			  {
254	          %>
255			     <option value="0<%=j%>"><%=j%></option>
256	          <%
257	          }
258			  for (int j=10; j<32;j++)
259			  {
260	          %>
261			     <option value="<%=j%>"><%=j%></option>
262	          <%
263	          }
264	          %>
265	       </select>日
266		</TD>
267	  </tr>
268	  <tr>
269		<TD width=150 align=center>返回方式</TD>
270		<TD width=250 align=left>
271		<input type="text" size="34" name="leave_byway"
272         style="border-style: solid; border-width: 1">
273		</TD>
274	  </tr>
275	  <tr>
276		<TD width=150 align=center>返回何处</TD>
277		<TD width=250 align=left>
278		<input type="text" size="34" name="leave_destination"
279          style="border-style: solid; border-width: 1">
280		</TD>
281	  </tr>  
282	</table>
283	  <input type="submit" value="确  定">
284	  <input type="reset" value="重  填">
285	  <input type="button" onClick="onClick()" value="退  出">
286	</form>
287	</center>
288	<%
289	   stmt.close();//关闭Statement对象
290	   pool.releaseConnection(con);  
291	}
292	catch (Exception e)
293	{
294	  out.println(e.getMessage());
295	}
296	 %>
297	</body>
298	</html>

⌨️ 快捷键说明

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