1. jsp Code :
Copy code The Code is as follows: <% --
Document: Application
Created on:, 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. output: copy Code the code is as follows: 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