1. Package:
Copy Code code as follows:
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 Code:
Copy Code code as follows:
<%--
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 "/>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<title>jsp page</title>
<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>
3. Output:
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.