ASCII码 ASCII码

JSP application(return String)用法详例

发布于:2022-04-02 10:51:53  栏目:技术文档
  1. JSP application(return String)用法详例
  1. JSP中application(return String)用法详例,需要用的朋友可以参考下代码。
  2. 1.JSP代码:
  1. <%--
  2. Document : Application
  3. Created on : 2009-10-4, 13:18:53
  4. Author : lucifer
  5. --%>
  6. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  8. "http://www.w3.org/TR/html4/loose.dtd">
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  12. <title>JSP Page</title>
  13. </head>
  14. <body>
  15. get Server Info:
  16. <%=application.getServerInfo()%>
  17. <br>
  18. get Context Path:
  19. <%=application.getContextPath()%>
  20. <br>
  21. get Real Path:
  22. <%=application.getRealPath("/Application.jsp")%>
  23. <br>
  24. </body>
  25. </html>
  1. 2.输出:
  1. get Server Info: Apache Tomcat/6.0.18
  2. get Context Path: /TestMethod
  3. get Real Path: D:\Program Files\NetBeans 6.7.1\www\TestMethod\build\web\Application.jsp
相关推荐
阅读 +