当前位置: 移动技术网 > IT编程>开发语言>Java > JSP application(return String)用法详例

JSP application(return String)用法详例

2017年12月12日  | 移动技术网IT编程  | 我要评论

南宁护士门,黑龙江省采购,木樨园长途汽车站时刻表

1.jsp代码:
复制代码 代码如下:

<%--
document : application
created on : 2009-10-4, 13:18:53
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">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>jsp page</title>
</head>
<body>
get server info:
<%=application.getserverinfo()%>
<br>
get context path:
<%=application.getcontextpath()%>
<br>
get real path:
<%=application.getrealpath("/application.jsp")%>
<br>
</body>
</html>

2.输出:
复制代码 代码如下:

get server info: apache tomcat/6.0.18
get context path: /testmethod
get real path: d:\program files\netbeans 6.7.1\www\testmethod\build\web\application.jsp

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网