JSP bean obtains various parameters

Source: Internet
Author: User

1. Package: Copy codeThe Code is 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 codeThe Code is as follows: <% --
Document: usebean
Created on:, 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. 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: 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.