五月综合缴情婷婷六月,色94色欧美sute亚洲线路二,日韩制服国产精品一区,色噜噜一区二区三区,香港三级午夜理伦三级三

您現(xiàn)在的位置: 365建站網(wǎng) > 365文章 > JSP獲取各種參數(shù)

JSP獲取各種參數(shù)

文章來源:365jz.com     點擊數(shù):1494    更新時間:2009-10-04 11:14   參與評論

包:

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");
     }
}

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>

輸出:

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.

如對本文有疑問,請?zhí)峤坏浇涣髡搲瑥V大熱心網(wǎng)友會為你解答??! 點擊進(jìn)入論壇

發(fā)表評論 (1494人查看0條評論)
請自覺遵守互聯(lián)網(wǎng)相關(guān)的政策法規(guī),嚴(yán)禁發(fā)布色情、暴力、反動的言論。
昵稱:
最新評論
------分隔線----------------------------

其它欄目

· 建站教程
· 365學(xué)習(xí)

業(yè)務(wù)咨詢

· 技術(shù)支持
· 服務(wù)時間:9:00-18:00
365建站網(wǎng)二維碼

Powered by 365建站網(wǎng) RSS地圖 HTML地圖

copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號