JSP bean获取各种参数

前端技术 2023/09/09 JSP
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\"%>
\"http://www.w3.org/TR/html4/loose.dtd\">




JSP Page


Operating System Name:



Operating System Version:



Operating System Architecture:





Runtime Environment Version(JDK version):



Runtime Environment Vendor(JDK vendor):





VM Version:



VM Vendor:



VM Name:





RTE Specification Version:



RTE Specification Vendor:



RTE Specification Name:





VM Specification Name:



VM Specification Version:



VM Specification Vendor:




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.

本文地址:https://www.stayed.cn/item/25534

转载请注明出处。

本站部分内容来源于网络,如侵犯到您的权益,请 联系我

我的博客

人生若只如初见,何事秋风悲画扇。