手机
当前位置:查字典教程网 >编程开发 >JSP教程 >JSP application(return String)用法详例
JSP application(return String)用法详例
摘要:1.JSP代码:复制代码代码如下:JSPPagegetServerInfo:getContextPath:getRealPath:2.输出:...

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 FilesNetBeans 6.7.1wwwTestMethodbuildwebApplication.jsp

【JSP application(return String)用法详例】相关文章:

JSP教程(七)-pluginAction的使用

JSP高访问量下的计数程序

JSP上传图片产生 java.io.IOException: Stream closed异常解决方法

JSP request(return String)用法详例

JSP中pluginAction的使用

response.setHeader参数、用法的介绍

response.setContentType()的作用及MIME参数详解

jsp中Action使用session方法实例分析

JSP生成jpeg图片用于投票

jsp与sql语句的混合使用示例

精品推荐
分类导航