易截截图软件、单文件、免安装、纯绿色、仅160KB

JSP 列出服务器环境变量

下面的是一个运行效果:
 
服务器环境变量
功能简述
localhost 
服务器的域名
192.168.0.5 
服务器的IP地址
Windows XP 
服务器操作系统
1.6.0 
服务器 Java 虚拟机版本
2.5 
服务器支持的 Servlet API 版本
2.1 
服务器支持的 JSP API 版本
Apache Tomcat/6.0.16 
服务器软件的名称及版本(建议 Tomcat 6.0)
8080 
服务器正在运行的端口
pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
服务器 CPU 类型
D:\Java\Tomcat6.0.16\webapps\ROOT\env.jsp 
请求的物理路径
null 
在域名根目录外的到被请求页面的路径
GET 
发出request的方式
null 
通过使用GET方法提交的任何数据
/env.jsp 
程序被调用的路径
127.0.0.1 
发出request请求的远端机器的名称
127.0.0.1 
发出request请求的远端机器的IP名称
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322) 
客户请求的浏览器类型
页面源代码:
env.jsp
<%--
env.jsp
检测服务器信息
@version: 1.00
Note:
TODO:
Date: 2005-10-10
@author: BeanSoft
--%>
<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="GBK"%>
<html>
<style>
a:hover{color:orange}
</style>
<title>服务器环境变量</title>
<body>
<p>&nbsp;
<table width=90% border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#99CCFF" style="border-collapse: collapse">
<tr>
<td width="50%" align="center" bgcolor="#99CCFF"><font color="#FFFFFF">服务器环境变量</font></td>
<td height="16" align="center" bgcolor="#99CCFF"><font color="#FFFFFF">功能简述</font></td>
</tr>
<tr>
<td width="50%"><%= request.getServerName()%> </td>
<td height="4">服务器的域名</td>
</tr>
<tr>
<td width="50%"><%= java.net.InetAddress.getLocalHost().getHostAddress() %> </td>
<td height="4">服务器的IP地址</td>
</tr>
<tr>
<td width="50%"><%=System.getProperty("os.na


相关文档:

传智播客——JSP(二)内置对象


一.request对象
   客户端的请求信息被封装在request对象中,通过它才能了解到客户的需求,然后做出响应。它是HttpServletRequest类的实例。
   当request对象获取用户提交的汉字字符时,会产生乱码,由下面的方法可以解决:
   Sting s2 = new String(s1.getBytes("iso8859-1"),"GB2312") ......

利用jsp上传excel

一、上传
引入包:org.apache.commons.fileupload.*
jsp代码: DiskFileUpload fu = new DiskFileUpload();
      List list = fu.parseRequest(request);
      if(list != null){
       System.out.println(list.size());
  ......

JSP内建对象

JSP内建对象- -                                      
① out - javax.servlet.jsp.jspWriter
   out对 ......

Servlets/JSP开发技术问答


为什么GenericServlet在init(ServletConfig config)基础上增加了一个init()方法?
init()方法被GenericServlet.init(ServletConfig config)方法调用。
init()方法方便了开发人员定制Servlet的初始化,而无须去维护ServletConfig对象的存储工作。
重写GenericServlet.init(ServletConfig config)必须要显示的调用super ......

用Jsp输出Word,PDF等文件时进行的设置

response.setContentType( "application/pdf" ); // MIME type for pdf doc
response.setHeader("Content-Disposition","attachment;filename=output.pdf;");

 
Sets the Content-Type header. Content-Type identifies the MIME type of the response document and the character set encoding.
To se ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号