您现在的位置是:网站首页> 编程资料编程资料
JSP application(return String)用法详例_JSP编程_
2023-05-25
341人已围观
简介 JSP application(return String)用法详例_JSP编程_
1.JSP代码:
<%--
Document : Application
Created on : 2009-10-4, 13:18:53
Author : lucifer
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
"http://www.w3.org/TR/html4/loose.dtd">
JSP Page
get Server Info:
<%=application.getServerInfo()%>
get Context Path:
<%=application.getContextPath()%>
get Real Path:
<%=application.getRealPath("/Application.jsp")%>
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
复制代码 代码如下:
<%--
Document : Application
Created on : 2009-10-4, 13:18:53
Author : lucifer
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
"http://www.w3.org/TR/html4/loose.dtd">
get Server Info:
<%=application.getServerInfo()%>
get Context Path:
<%=application.getContextPath()%>
get Real Path:
<%=application.getRealPath("/Application.jsp")%>
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
您可能感兴趣的文章:
