版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
/JavaWeb编程技术沈泽刚秦玉平主编清华大学出版社20103作者E-mail地址:电话:单位:渤海大学信息科学与工程学院感谢您使用本书,下面是书中全部程序代码。如有任何问题,希望联系作者。程序1.1index.html<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Strict//EN"""><html><head><metahttp-equiv="content-type"content="text/html;charset=gb2312"/><metahttp-equiv="content-language"content="zh-cn"/><title>NewCenturyWebBookstore</title></head><bodybgcolor="#ffffff"><tablealign="center"border="0"cellpadding="0"cellspacing="0"width="540"><tr><tdalign="center"width="20%"> <imgsrc="images/duke.gif"align="right"alt="Hereisalogo."></td><tdwidth="80%"><palign="center"><fontsize="+2"color="red">新世纪</font><fontsize="+2"color="purple">网上书店</font></p></td></tr><tr><tdwidth="20%"><br><palign="center"><b>图书分类</b></p><ul><li><ahref="book.do?catalog=computer">计算机</a></li><li><ahref="book.do?catalog=industry">工业技术</a></li><li><ahref="book.do?catalog=science">自然科学</a></li><li><ahref="book.do?catalog=architect">建筑水利</a></li></ul></td><tdwidth="80%"><palign="center"><b>世界读书日,读一本好书,受益一生!</b></p><pstyle="text-indent:2em">通过开展为期一个月(4.23-5.23)读书节活动,切实引导大家多读书、乐读书、读好书,拓宽视野,引导大家从中认识“真、善、美”,树立正确的人生观、价值观,提高全民人文素养。</p></td></tr><tr><tdwidth="20%"> </td><tdwidth="80%"> <hrwidth="50%"align="right"size="1"color="blue"/><palign="right"><fontcolor="blue">Copyright©2009NewCenturyWebBookstore,Inc.</font></p></td></tr></table></body></html>_____________________________________________________________________________▃程序1.2register.html<html><head><metahttp-equiv="content-type"content="text/html;charset=gb2312"/><metahttp-equiv="content-language"content="zh-cn"/><title>RegisterPage</title><styletype="text/css">p{font-size:11</style></head><body><formaction=""method="post"><p>姓名:<inputtype="text"name="name"size="15">年龄:<inputtype="text"name="age"size="5"><br>性别:<inputtype="radio"name="sex"value="male">男<inputtype="radio"name="sex"value="female">女<br>兴趣:<inputtype="checkbox"name="hobby"value="read">文学<inputtype="checkbox"name="hobby"value="sport">体育<inputtype="checkbox"name="hobby"value="computer">电脑<br>最高学历:<selectname="study"width="15"><optionvalue="bachelor">学士</option><optionvalue="master">硕士</option><optionvalue="doctor">博士</option></select>邮件地址:<inputtype="text"name="email"size="20"><br><inputtype="submit"name="submit"value="提交"><inputtype="reset"name="reset"value="重添"></p></form></body></html>_____________________________________________________________________________▃程序1.3inputCheck.html<html><head><scriptlanguage="JavaScript"type="text/javascript">functioncustCheck(){varcustName=document.getElementById("custName");varemail=document.getElementById("email");varphone=document.getElementById("phone");if(custName.value==""){alert("客户名不能为空!");returnfalse;}elseif(email.value.indexOf("@")==-1){alert("电子邮件中应包含@字符!");returnfalse;}elseif(phone.value.length!=8){alert("电话号码应是8位数字!");returnfalse;}}</script><styletype="text/css">*,input{font-size:11</style></head><body><formaction="/helloapp/inputCustomer"method="post"onSubmit="returncustCheck()">请输入客户信息:<table><tr><td>客户名:</td><td><inputtype="text"name="custName"id="custName"></td></tr><tr><td>Email地址:</td><td><inputtype="text"name="email"id="email"></td></tr><tr><td>电话:</td><td><inputtype="text"name="phone"id="phone"></td></tr></table><inputtype="submit"value="确定"><inputtype="reset"value="重置"></form></body></html>_____________________________________________________________________________▃程序1.4HelloServlet.javapackagecom.demo;importjava.io.*;importjavax.servlet.*;importjavax.servlet.http.*;publicclassHelloServletextendsHttpServlet{publicvoidservice(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{PrintWriterout=response.getWriter();out.println("<html>");out.println("<body>");out.println("<fontcolor='#0000ff'>");out.println("<h3>Hello,World!</h3>");out.println("Thetimenowis:"+newjava.util.Date());out.println("</body>");out.println("</html>");}}_____________________________________________________________________________▃程序1.5web.xml<?xmlversion="1.0"encoding="UTF-8"?><web-appxmlns=""xmlns:xsi=""xsi:schemaLocation=""version="2.5"><servlet><servlet-name>helloServlet</servlet-name><servlet-class>com.demo.HelloServlet</servlet-class></servlet><servlet-mapping><servlet-name>helloServlet</servlet-name><url-pattern>/hello</url-pattern></servlet-mapping></web-app>_____________________________________________________________________________▃程序1.6hello.jsp<html><head><title>ASimpleJSPPage</title></head><body><fontcolor="#0000ff"><h3>Hello,World!</h3>Thetimenowis:<%=newjava.util.Date()%></font></body></html>_____________________________________________________________________________▃程序1.7square.jsp<html><body><tableborder="1"cellspacing="0"cellpadding="5"><tr><th>number</th><th>squared</th></tr><%for(inti=0;i<10;i++){%><tr><td><%=i%></td><td><%=(i*i)%></td></tr><%}%></table></body></html>_____________________________________________________________________________▃程序2.1login.html<html><head><title>LoginPage</title></head><body><formaction="login"method="post"><tablewidth="298"border="0"align="center"cellpading="2"cellspacing="1"> <tr><tdalign="right">用户名:</td><tdalign="left"><inputtype="text"name="username"size="15"></td></tr><tr> <tdalign="right">密 码:</td><td><inputtype="password"name="password"size="15"></td></tr><tr><tdcolspan="2"align="center"><inputtype="submit"value="登录"> <inputtype="reset"value="取消"></td></tr></form></body></html>_____________________________________________________________________________▃程序2.2LoginServlet.javapackagecom.demo;importjava.io.*;importjavax.servlet.*;importjavax.servlet.http.*;publicclassLoginServletextendsHttpServlet{publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{Stringusername=request.getParameter("username");Stringpassword=request.getParameter("password");response.setContentType("text/html;charset=gb2312");PrintWriterout=response.getWriter();out.println("<html><body>");if(username.equals("admin")&&password.equals("admin")){out.println("登录成功!欢迎您,"+username);}else{out.println("对不起!您的用户名或密码不正确.");}out.println("</body></html>");}publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{doPost(request,response);}}_____________________________________________________________________________▃程序2.3exam.html<html><head><title>ASimpleExam</title><styletype="text/css">h3,p{text-indent:2em;font-size:85%}</style></head><body><h3>请回答下面的问题:</h3><formaction="exam.do"method="post"><p>1.在北京召开的奥运会是第29届奥运会。<inputtype="radio"name="quest1"value="1">正确<inputtype="radio"name="quest1"value="2">错误</p><p>2.Windows操作系统是哪个公司的产品?<inputtype="radio"name="quest2"value="1">Sun公司<inputtype="radio"name="quest2"value="2">IBM公司<inputtype="radio"name="quest2"value="3">Microsoft公司</p><p>3.下面的程序设计语言,哪些是面向对象的?<inputtype="checkbox"name="quest3"value="1">Java语言<inputtype="checkbox"name="quest3"value="2">C语言<inputtype="checkbox"name="quest3"value="3">C++语言</p><p>4.编写Servlet程序应继承什么类?<inputtype="text"name="quest4"size="30"></p><p><b>交卷请点击:</b><inputtype="submit"value="交卷"><b>重答请点击:</b><inputtype="reset"value="重答"></p></form></body></html>_____________________________________________________________________________▃程序2.4ExamServlet.javapackagecom.exam;importjavax.servlet.*;importjavax.servlet.http.*;importjava.io.*;publicclassExamServletextendsHttpServlet{ publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)throwsIOException,ServletException{ response.setContentType("text/html;charset=GB2312");PrintWriterout=response.getWriter();Stringquest1=request.getParameter("quest1");String[]quest2=request.getParameterValues("quest2");String[]quest3=request.getParameterValues("quest3");Stringquest4=request.getParameter("quest4").trim();intscore=0;if(quest1!=null&&quest1.equals("1")){score=score+25;}if(quest2!=null&&quest2[0].equals("3")){score=score+25; }if(quest3!=null&&quest3.length==2&&quest3[0].equals("1")&&quest3[1].equals("3")){score=score+25; }if(quest4!=null&&(quest4.equals("HttpServlet")||quest4.equals("javax.servlet.http.HttpServlet"))){score=score+25; }out.println("<html><head>");out.println("<title>考试结果</title>");out.println("</head><body>");out.println("你的成绩是:"+score+"分");out.println("</body></html>");}}_____________________________________________________________________________▃程序2.5ClientInfoServlet.javapackagecom.demo;importjava.io.*;importjava.util.*;importjavax.servlet.*;importjavax.servlet.http.*;publicclassClientInfoServletextendsHttpServlet{ publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ response.setContentType("text/html;charset=GB2312"); PrintWriterout=response.getWriter(); out.println("<html><head>"); out.println("<title>获取客户端信息</title>"); out.println("</head>"); out.println("<body>"); out.println("<h4>客户端信息:</h4>"); out.println("<tablewidth=\"350\"border=\"1\">"); out.println("<tr><tdwidth=\"175\">客户主机名</td>"); out.println("<tdwidth=\"175\">"+request.getRemoteHost()+"</td>"); out.println("</tr>"); out.println("<tr><td>客户IP地址</td>"); out.println("<td>"+request.getRemoteAddr()+"</td>"); out.println("</tr>"); out.println("<tr><td>端口</td>"); out.println("<td>"+request.getRemotePort()+"</td>"); out.println("</tr>"); out.println("<tr><td>请求方法</td>"); out.println("<td>"+request.getMethod()+"</td>"); out.println("</tr>"); out.println("<tr><td>请求协议</td>"); out.println("<td>"+request.getProtocol()+"</td>"); out.println("</tr>"); out.println("<tr><td>编码方式</td>"); out.println("<td>"+request.getCharacterEncoding()+"</td>"); out.println("</tr>");out.println("<tr><td>内容类型</td>"); out.println("<td>"+request.getContentType()+"</td>"); out.println("</tr>"); out.println("<tr><td>请求URI</td>"); out.println("<td>"+request.getRequestURI()+"</td>"); out.println("</tr>"); out.println("</table>"); out.println("</body></html>"); } publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ doGet(request,response); } }_____________________________________________________________________________▃程序2.6ShowHeadersServlet.javapackagecom.demo;importjava.io.*;importjavax.servlet.*;importjavax.servlet.http.*;importjava.util.Enumeration;publicclassShowHeadersServletextendsHttpServlet{publicvoidservice(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{response.setContentType("text/html;charset=gb2312");PrintWriterout=response.getWriter();out.println("<html><body>");out.println("下面是服务器收到的请求头信息<p>");out.println(request.getMethod()+"" +request.getRequestURI()+"" +request.getQueryString()+"" +request.getProtocol()+"<br>");Enumerationheaders=request.getHeaderNames();while(headers.hasMoreElements()){Stringheader=(String)headers.nextElement();Stringvalue=request.getHeader(header);out.println(header+"="+value+"<br>");}out.println("</body></html>");}}_____________________________________________________________________________▃程序2.7LoginServlet.javapackagecom.demo;importjava.io.*;importjavax.servlet.*;importjavax.servlet.http.*;publicclassLoginServletextendsHttpServlet{publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{Stringusername=request.getParameter("username");Stringpassword=request.getParameter("password");Stringlocation=""; if(username.equals("admin")&&password.equals("admin")){request.setAttribute("username",username);location="/hello.jsp";}else{location="/login.html";}RequestDispatcherdispatcher=request.getRequestDispatcher(location);dispatcher.forward(request,response);}}_____________________________________________________________________________▃程序2.8hello.jsp<html><body><h4>Yourarewelcome!</h4><%=request.getAttribute("username")%></body></html>_____________________________________________________________________________▃程序2.9ExcelServlet.javapackagecom.demo;importjava.io.*;importjava.util.*;importjavax.servlet.*;importjavax.servlet.http.*;publicclassExcelServletextendsHttpServlet{publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{//指定页面在传输过程中使用的编码方式response.setHeader("Content-Encoding","gb2312");response.setContentType("application/vnd.ms-excel;charset=gb2312");PrintWriterout=response.getWriter();out.println("学号\t姓名\t性别\t年龄\t所在系");out.println("95001\t李勇\t男\t20\t信息");out.println("95002\t刘晨\t女\t19\t数学");}}_____________________________________________________________________________▃程序2.10packagecom.demo;importjava.io.*;importjavax.servlet.*;importjavax.servlet.http.*;publicclassextendsHttpServlet{publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{response.setContentType("application/jar");//设置响应头,将响应内容以指定的文件名存储到客户机上response.setHeader("Content-Disposition","attachment;");Filef=newFile("C:\\servlet-api.jar");is=new(f);ServletOutputStreamos=response.getOutputStream();byte[]bytearray=newbyte[1024];intbytesread=0;while((bytesread=is.read(bytearray))!=-1){os.write(bytearray,0,bytesread);}os.flush();}}_____________________________________________________________________________▃程序2.11ShowTimeServlet.javapackagecom.demo;importjava.io.*;importjava.util.*;importjava.text.SimpleDateFormat;importjavax.servlet.*;importjavax.servlet.http.*;publicclassShowTimeServletextendsHttpServlet{publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{response.setContentType("text/html;charset=gb2312");response.setHeader("Refresh","5");PrintWriterout=response.getWriter();Datedate=newDate();SimpleDateFormatsdf=newSimpleDateFormat("yyyy-MM-ddaHH:mm:ss");Strings=sdf.format(date);//对日期对象格式化out.println("<html>");out.println("<body>");out.println("<h3align=\"center\">每5秒钟刷新一次页面</h3><p>");out.println("<h3align=\"center\">现在的时间是:"+s+"</h3><p>");out.println("</body>");out.println("</html>");}}_____________________________________________________________________________▃程序2.12RedirectServlet.javapackagecom.demo;importjava.io.*;importjavax.servlet.*;importjavax.servlet.http.*;publicclassRedirectServletextendsHttpServlet{ publicvoiddoGet(HttpServletRequestrequest, HttpServletResponseresponse) throwsIOException,ServletException{ StringuserAgent=request.getHeader("User-Agent"); if((userAgent!=null)&&(userAgent.indexOf("MSIE")!=-1)){ response.sendRedirect("");return; }else{ response.sendRedirect("");return; } }}_____________________________________________________________________________▃程序3.1web.xml文件。<?xmlversion="1.0"encoding="UTF-8"?><web-appxmlns=""xmlns:xsi=""xsi:schemaLocation=""version="2.5"><display-name>WebappTest</display-name><context-param><param-name>email</param-name><param-value></param-value></context-param><servlet><servlet-name>loginServlet</servlet-name><servlet-class>com.demo.LoginServlet</servlet-class><init-param><param-name>greeting</param-name><param-value>GoodMorning</param-value></init-param><load-on-startup>2</load-on-startup></servlet><servlet-mapping><servlet-name>loginServlet</servlet-name><url-pattern>/login.do</url-pattern></servlet-mapping><welcome-><welcome-</welcome-file><welcome-</welcome-file></welcome-><session-config><session-timeout>20</session-timeout></session-config></web-app>_____________________________________________________________________________▃程序3.2web.xml<?xmlversion="1.0"encoding="ISO-8859-1"?><web-app…><servlet><servlet-name>configDemoServlet</servlet-name><servlet-class>com.demo.ConfigDemoServlet</servlet-class><init-param><param-name>email</param-name><param-value></param-value></init-param><init-param><param-name>telephone</param-name><param-value></param-value></init-param><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>configDemoServlet</servlet-name><url-pattern>/configDemo.do</url-pattern></servlet-mapping></web-app>_____________________________________________________________________________▃程序3.3ConfigDemoServlet.javapackagecom.demo;importjava.io.*;importjava.sql.*;importjavax.servlet.*;importjavax.servlet.http.*;publicclassConfigDemoServletextendsHttpServlet{StringservletName=null;ServletConfigconfig=null;Stringemail=null;Stringtelephone=null;publicvoidinit(){config=getServletConfig();servletName=config.getServletName();email=config.getInitParameter("email");telephone=config.getInitParameter("telephone");}publicvoidservice(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{response.setContentType("text/html;charset=gb2312");PrintWriterout=response.getWriter();out.println("<html><body>");out.println("Servlet名称:"+servletName+"<br>");out.println("Email地址:"+email+"<br>"); out.println("电话:"+telephone);out.println("</body></html>");}}_____________________________________________________________________________▃程序3.4packagecom.demo;importjava.io.*;import.*;importjavax.servlet.*;importjavax.servlet.http.*;publicclassextendsHttpServlet{publicvoidservice(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{response.setContentType("application/jar");response.setHeader("Content-Disposition","attachment;");OutputStreamos=response.getOutputStream();ServletContextcontext=getServletContext();URLurl=context.getResource("/");InputStreamis=url.openStream();//上面两行代码可以用下面一行实现//InputStreamis=context.getResourceAsStream("/");byte[]bytearray=newbyte[1024];intbytesread=0;while((bytesread=is.read(bytearray))!=-1){os.write(bytearray,0,bytesread);}os.flush();is.close();}}_____________________________________________________________________________▃程序3.5CalculatorServlet.javapackagecom.demo;importjavax.servlet.*;importjavax.servlet.http.*;importjava.io.*;publicclassCalculatorServletextendsHttpServlet{privateintresult;privateintsleepTime;publicvoidinit(){ Stringsleep_time=getInitParameter("sleep.time"); sleepTime=getNumber(sleep_time);}publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)throwsIOException,ServletException{request.setCharacterEncoding("gb2312");Stringvalue1=request.getParameter("value1");intv1=getNumber(value1);Stringvalue2=request.getParameter("value2");intv2=getNumber(value2);Stringop=request.getParameter("submit");if(op.equals("相加")){ result=v1+v2;}else{ result=v1-v2;}try{ Thread.sleep(sleepTime);}catch(InterruptedExceptione){ log("Exceptionduringsleeping.");}try{ response.setContentType("text/html;charset=gb2312"); PrintWriterout=response.getWriter(); out.println("<html><body>"); out.println(v1+"与"+v2+op+"结果是"+result); out.println("</body></html>");}catch(Exceptione){ log("Errorwritingoutput.");}}privateintgetNumber(Strings){ intresult=0;try{ result=Integer.parseInt(s); }catch(NumberFormatExceptione){ log("ErrorParseing"+s); } returnresult;}}_____________________________________________________________________________▃程序3.6calculator.html<html><head><title>Calcularor</title><metahttp-equiv="content-type"content="text/html;charset=gb2312"</head><body>请输入两个整数:<formaction="calculator"method="post"> <p>操作数1:<inputtype="text"name="value1"size="10"> 操作数2:<inputtype="text"name="value2"size="10"></p> <p><inputtype="submit"name="submit"value="相加"> <inputtype="submit"name="submit"value="相减"></p></form></body></html>_____________________________________________________________________________▃程序3.7login.html<html><head><title>ABankExample</title></head><body><center>请输入用户名和口令查看账户信息<br></center><formaction="login.do"method="get"><tablewidth="298"border="0"align="center"cellpading="2"cellspacing="1"> <tr><tdalign="right">用户名:</td><tdalign="left"><inputtype="text"name="username"size="15"></td></tr><tr> <tdalign="right">密 码:</td><td><inputtype="password"name="password"size="15"></td></tr><tr><tdcolspan="2"align="center"><inputtype="submit"value="登录"> <inputtype="reset"value="取消"></td></tr></form></body></html>_____________________________________________________________________________▃程序3.8LoginServlet.javapackagecom.demo;importjava.io.*;importjavax.servlet.*;importjavax.servlet.http.*;importjava.util.HashMap;publicclassLoginServletextendsHttpServlet{ServletContextcontext;HashMap<String,String>users=newHashMap<String,String>();publicvoidinit(){context=getServletContext();users.put("ann","aaa");users.put("john","jjj");users.put("mark","mmm");}publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{doPost(request,response);}publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{Stringusername=request.getParameter("username");Stringpassword=request.getParameter("password");if(username!=null&&password!=null&&password.equals(users.get(username))){request.setAttribute("username",username);RequestDispatcherview= context.getRequestDispatcher("/account.do");view.forward(request,response);return;}else{RequestDispatcherview=context.getRequestDispatcher("/error.html");view.forward(request,response);return; }}}_____________________________________________________________________________▃程序3.9AccountServlet.javapackagecom.demo;importjava.io.*;importjavax.servlet.*;importjavax.servlet.http.*;importjava.util.HashMap;publicclassAccountServletextendsHttpServlet{ServletContextcontext;HashMap<String,String[]>data=newHashMap<String,String[]>();publicvoidinit(){context=getServletContext();data.put("ann",newString[]{"01/01/2009"01/02/2009:1300.00","01/03/2009data.put("john",newString[]{"01/01/2009"01/02/2009:2100.00","01/03/2009data.put("mark",newString[]{"01/01/2009"01/02/2009:5200.00","01/03/2009}publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{Stringusername=(String)request.getAttribute("username");if(username!=null){String[]records=(String[])data.get(username);response.setContentType("text/html;charset=gb2312");PrintWriterout=response.getWriter();out.println("<html>");out.println("<body>");out.println("您好!"+username+",您的账户信息如下:<p>");for(inti=0;i<records.length;i++){out.println(records[i]+"<br>");}out.println("</body>");out.println("</html>");}else{RequestDispatcherview=context.getRequestDispatcher("/login.html");view.forward(request,response);}}publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{doPost(request,response);}}_____________________________________________________________________________▃程序4.1ShowSessionServlet.javapackagecom.demo;importjava.io.*;importjavax.servlet.*;importjavax.servlet.http.*;importjava.util.Date;publicclassShowSessionServletextendsHttpServlet{publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{response.setContentType("text/html;charset=gb2312");HttpSessionsession=request.getSession(true);Stringheading=null;IntegeraccessCount=(Integer)session.getAttribute("accessCount");if(accessCount==null){accessCount=newInteger(1); heading="欢迎您,首次登录该页面!";}else{ heading="欢迎您,再次访问该页面!"; accessCount=accessCount+1;}session.setAttribute("accessCount",accessCount);PrintWriterout=response.getWriter();out.println("<html><head>");out.println("<title>SessionTrackingExample</title></head>");out.println("<body><center>");out.println("<h4>"+heading+"<ahref='showsession.do'>再次访问</a>"+"</h4>");out.println("<tableborder='0'>");out.println("<trbgcolor=\"ffad00\"><td>信息<td>值\n");Stringstate=session.isNew()?"新会话":"旧会话";out.println("<tr><td>会话状态:<td>"+state+"\n");out.println("<tr><td>会话ID:<td>"+session.getId()+"\n");out.println("<tr><td>创建时间:<td>");out.println(""+newDate(session.getCreationTime())+"\n");out.println("<tr><td>最近访问时间:<td>");out.println(""+newDate(session.getLastAccessedTime())+"\n");out.println("<tr><td>最大不活动时间:<td>"+session.getMaxInactiveInterval()+"\n");o
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年度三亚安置房销售合同模板(环保材料)3篇
- 2024年智能家居橱柜定制专项服务合同3篇
- 2024年度校园消防安全评估与改进服务合同3篇
- 2024年度城市轨道交通工程信号系统承包合同2篇
- 2024年度环保设施施工图设计合同范本2篇
- 2024年度企业培训视频制作合同3篇
- 2024年度水利工程设备运输及安装服务合同2篇
- 2024年标准工程支付款项清算具体合同
- 2024年物流公司驾驶员承包合同
- 2024年度中央空调盘管更换合同2篇
- 期末综合卷(含答案) 2024-2025学年苏教版数学六年级上册
- 2025春夏运动户外行业趋势白皮书
- 中医筋伤的治疗
- 【MOOC】英文技术写作-东南大学 中国大学慕课MOOC答案
- 护理产科健康教育
- 《〈论语〉十二章》说课稿 2024-2025学年统编版高中语文选择性必修上册
- 2024年PE工程师培训教材:深入浅出讲解
- 数字华容道+课时2
- 期末模拟考试卷01-2024-2025学年上学期高一思想政治课《中国特色社会主义》含答案
- 2024年21起典型火灾案例及消防安全知识专题培训(消防月)
- 人教版四年级上册数学【选择题】专项练习100题附答案
评论
0/150
提交评论