jsp

位置:IT落伍者 >> jsp >> 浏览文章

JSP中bean的使用


发布日期:2019年11月15日
 
JSP中bean的使用



packagebeanpackage;

/**
*
*@authorlucifer
*/
publicclassSystemPRoperties{
publicStringgetRuntimeEnvironmentVersion(){
returnSystemgetProperty("javaversion");
}
publicStringgetRuntimeEnvironmentVendor(){
returnSystemgetProperty("javavendor");
}

publicStringgetVmVersion(){
returnSystemgetProperty("javavmversion");
}
publicStringgetVmVendor(){
returnSystemgetProperty("javavmvendor");
}
publicStringgetVmName(){
returnSystemgetProperty("javavmname");
}

publicStringgetVmSpecVersion(){
returnSystemgetProperty("javavmspecificationversion");
}
publicStringgetVmSpecVendor(){
returnSystemgetProperty("javavmspecificationvendor");
}
publicStringgetVmSpecName(){
returnSystemgetProperty("javavmspecificationname");
}

publicStringgetRteSpecName(){
returnSystemgetProperty("javaspecificationname");
}
publicStringgetRteSpecVersion(){
returnSystemgetProperty("javaspecificationversion");
}
publicStringgetRteSpecVendor(){
returnSystemgetProperty("javaspecificationvendor");
}

publicStringgetOperatingSystemName(){
returnSystemgetProperty("osname");
}
publicStringgetOperatingSystemVersion(){
returnSystemgetProperty("osversion");
}
publicStringgetOperatingSystemArchitecture(){
returnSystemgetProperty("osarch");
}
}


jsp代码

<%
Document:usebean
Createdon:::
Author:lucifer
%>

<%@pagecontentType="text/html"pageEncoding="UTF"%>
<!DOCTYPEHTMLPUBLIC"//WC//DTDHTMLTransitional//EN"
"
<jsp:useBeanid="properties"class="beanpackageSystemProperties"/>
<html>
<head>
<metahttpequiv="ContentType"content="text/html;charset=UTF">
<title>JSPPage</title>
</head>
<body>
OperatingSystemName:
<jsp:getPropertyname="properties"property="operatingSystemName"/>
<br>
OperatingSystemVersion:
<jsp:getPropertyname="properties"property="operatingSystemVersion"/>
<br>
OperatingSystemArchitecture:
<jsp:getPropertyname="properties"property="operatingSystemArchitecture"/>
<br>
<br>
RuntimeEnvironmentVersion(JDKversion):
<jsp:getPropertyname="properties"property="runtimeEnvironmentVersion"/>
<br>
RuntimeEnvironmentVendor(JDKvendor):
<jsp:getPropertyname="properties"property="runtimeEnvironmentVendor"/>
<br>
<br>
VMVersion:
<jsp:getPropertyname="properties"property="vmVersion"/>
<br>
VMVendor:
<jsp:getPropertyname="properties"property="vmVendor"/>
<br>
VMName:
<jsp:getPropertyname="properties"property="vmName"/>
<br>
<br>
RTESpecificationVersion:
<jsp:getPropertyname="properties"property="rteSpecVersion"/>
<br>
RTESpecificationVendor:
<jsp:getPropertyname="properties"property="rteSpecVendor"/>
<br>
RTESpecificationName:
<jsp:getPropertyname="properties"property="rteSpecName"/>
<br>
<br>
VMSpecificationName:
<jsp:getPropertyname="properties"property="vmSpecName"/>
<br>
VMSpecificationVersion:
<jsp:getPropertyname="properties"property="vmSpecVersion"/>
<br>
VMSpecificationVendor:
<jsp:getPropertyname="properties"property="vmSpecVendor"/>
</body>
</html>

输出

OperatingSystemName:WindowsVista
OperatingSystemVersion:
OperatingSystemArchitecture:x

RuntimeEnvironmentVersion(JDKversion):_
RuntimeEnvironmentVendor(JDKvendor):SunMicrosystemsInc

VMVersion:b
VMVendor:SunMicrosystemsInc
VMName:JavaHotSpot(TM)ClientVM

RTESpecificationVersion:
RTESpecificationVendor:SunMicrosystemsInc
RTESpecificationName:JavaPlatformAPISpecification

VMSpecificationName:JavaVirtualMachineSpecification
VMSpecificationVersion:
VMSpecificationVendor:SunMicrosystemsInc

上一篇:JSP FusionCharts Free显示图表 具体实现

下一篇:JSP中的汉字编码问题