作业帮 > JSP > 教育资讯

JSP用bean获取各种参数[1]

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/27 08:10:39 JSP
JSP用bean获取各种参数[1]
JSP用bean获取各种参数[1]JSP
【51Test.NET - JSP】
JSP用bean获取各种参数

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="UJSP