时间:2021-05-26
1.包:
复制代码 代码如下:
package beanpackage;
/**
*
* @author lucifer
*/
public class SystemProperties {
public String getRuntimeEnvironmentVersion(){
return System.getProperty("java.version");
}
public String getRuntimeEnvironmentVendor(){
return System.getProperty("java.vendor");
}
public String getVmVersion(){
return System.getProperty("java.vm.version");
}
public String getVmVendor(){
return System.getProperty("java.vm.vendor");
}
public String getVmName(){
return System.getProperty("java.vm.name");
}
public String getVmSpecVersion(){
return System.getProperty("java.vm.specification.version");
}
public String getVmSpecVendor(){
return System.getProperty("java.vm.specification.vendor");
}
public String getVmSpecName(){
return System.getProperty("java.vm.specification.name");
}
public String getRteSpecName(){
return System.getProperty("java.specification.name");
}
public String getRteSpecVersion(){
return System.getProperty("java.specification.version");
}
public String getRteSpecVendor(){
return System.getProperty("java.specification.vendor");
}
public String getOperatingSystemName(){
return System.getProperty("os.name");
}
public String getOperatingSystemVersion(){
return System.getProperty("os.version");
}
public String getOperatingSystemArchitecture(){
return System.getProperty("os.arch");
}
}
2.JSP代码:
复制代码 代码如下:
<%--
Document : usebean
Created on : 2009-10-3, 13:06:24
Author : lucifer
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="properties" class="beanpackage.SystemProperties"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
Operating System Name:
<jsp:getProperty name="properties" property="operatingSystemName"/>
<br>
Operating System Version:
<jsp:getProperty name="properties" property="operatingSystemVersion"/>
<br>
Operating System Architecture:
<jsp:getProperty name="properties" property="operatingSystemArchitecture"/>
<br>
<br>
Runtime Environment Version(JDK version):
<jsp:getProperty name="properties" property="runtimeEnvironmentVersion"/>
<br>
Runtime Environment Vendor(JDK vendor):
<jsp:getProperty name="properties" property="runtimeEnvironmentVendor"/>
<br>
<br>
VM Version:
<jsp:getProperty name="properties" property="vmVersion"/>
<br>
VM Vendor:
<jsp:getProperty name="properties" property="vmVendor"/>
<br>
VM Name:
<jsp:getProperty name="properties" property="vmName"/>
<br>
<br>
RTE Specification Version:
<jsp:getProperty name="properties" property="rteSpecVersion"/>
<br>
RTE Specification Vendor:
<jsp:getProperty name="properties" property="rteSpecVendor"/>
<br>
RTE Specification Name:
<jsp:getProperty name="properties" property="rteSpecName"/>
<br>
<br>
VM Specification Name:
<jsp:getProperty name="properties" property="vmSpecName"/>
<br>
VM Specification Version:
<jsp:getProperty name="properties" property="vmSpecVersion"/>
<br>
VM Specification Vendor:
<jsp:getProperty name="properties" property="vmSpecVendor"/>
</body>
</html>
3.输出:
Operating System Name: Windows Vista
Operating System Version: 6.0
Operating System Architecture: x86
Runtime Environment Version(JDK version): 1.6.0_16
Runtime Environment Vendor(JDK vendor): Sun Microsystems Inc.
VM Version: 14.2-b01
VM Vendor: Sun Microsystems Inc.
VM Name: Java HotSpot(TM) Client VM
RTE Specification Version: 1.6
RTE Specification Vendor: Sun Microsystems Inc.
RTE Specification Name: Java Platform API Specification
VM Specification Name: Java Virtual Machine Specification
VM Specification Version: 1.0
VM Specification Vendor: Sun Microsystems Inc.
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
JSP获取spring容器中bean的方法总结方案1(Web中使用):ApplicationContextct=WebApplicationContextUti
jsp中定义实体bean获取bean的属性值,并将值输出到页面上;EL表达式:${实体对象名称}el表达式取数据时,通常用.号,.号取不出来就用[]pageCo
复制代码代码如下:JSP和JSTL获取服务器参数JSP方式 JSTL方式${pageContext.request}|取得请求对象${pageCont
表单(Forms)是在网站交互的一个很普通的方法。JSP使表单处理更加简单。在JSP中处理表单的标准方法是定义一个“bean”。这个“bean”不是一个完全的J
1、login.jsp页面程序复制代码代码如下:functionchangeValidateCode(obj){//获取当前的时间作为参数,无具体意义varti