Java EE Servlet 几个path
ContextPath
Context ['kɒntekst]
不识庐山真面目,只缘身在此山中。
相对路径
RealPath
绝对路径
ServletPath
就是servlet-mapping 中 的 url-pattern
<servlet-mapping> <servlet-name>TestServlet</servlet-name> <url-pattern>/TestServlet</url-pattern> </servlet-mapping>
contextPath: /zztest servletPath: /TestServlet realPath: F:\e\workspaceflex\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\zztest\
java.runtime.name: Java(TM) SE Runtime Environment sun.boot.library.path: E:\Oracle\jdk1.6.0_24_x64\jre\bin java.vm.version: 20.45-b01 shared.loader: java.vm.vendor: Sun Microsystems Inc. java.vendor.url: http://java.sun.com/ path.separator: ; tomcat.util.buf.StringCache.byte.enabled: true java.vm.name: Java HotSpot(TM) Client VM file.encoding.pkg: sun.io sun.java.launcher: SUN_STANDARD user.country: US sun.os.patch.level: Service Pack 1 java.vm.specification.name: Java Virtual Machine Specification user.dir: F:\e\eclipse\sts-3.8.1.RELEASE java.runtime.version: 1.6.0_45-b06 org.apache.catalina.startup.TldConfig.jarsToSkip: tomcat7-websocket.jar java.awt.graphicsenv: sun.awt.Win32GraphicsEnvironment java.endorsed.dirs: F:\e\tomcat\apache-tomcat-7.0.70\endorsed os.arch: x86 java.io.tmpdir: C:\Users\wl\AppData\Local\Temp\ line.separator: java.vm.specification.vendor: Sun Microsystems Inc. java.naming.factory.url.pkgs: org.apache.naming user.variant: os.name: Windows 7 sun.jnu.encoding: Cp1252 tomcat.util.scan.DefaultJarScanner.jarsToSkip: bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,websocket-api.jar,catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,jasper.jar,jasper-el.jar,ecj-*.jar,tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,tomcat-jni.jar,tomcat-spdy.jar,tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,tomcat-juli-adapters.jar,catalina-jmx-remote.jar,catalina-ws.jar,tomcat-jdbc.jar,tools.jar,commons-beanutils*.jar,commons-codec*.jar,commons-collections*.jar,commons-dbcp*.jar,commons-digester*.jar,commons-fileupload*.jar,commons-httpclient*.jar,commons-io*.jar,commons-lang*.jar,commons-logging*.jar,commons-math*.jar,commons-pool*.jar,jstl.jar,taglibs-standard-spec-*.jar,geronimo-spec-jaxrpc*.jar,wsdl4j*.jar,ant.jar,ant-junit*.jar,aspectj*.jar,jmx.jar,h2*.jar,hibernate*.jar,httpclient*.jar,jmx-tools.jar,jta*.jar,log4j.jar,log4j-1*.jar,mail*.jar,slf4j*.jar,xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,junit.jar,junit-*.jar,hamcrest*.jar,org.hamcrest*.jar,ant-launcher.jar,cobertura-*.jar,asm-*.jar,dom4j-*.jar,icu4j-*.jar,jaxen-*.jar,jdom-*.jar,jetty-*.jar,oro-*.jar,servlet-api-*.jar,tagsoup-*.jar,xmlParserAPIs-*.jar,xom-*.jar java.library.path: E:\Oracle\jdk1.6.0_24_x64\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;E:\Oracle\jdk1.6.0_24_x64\jre\bin;F:/e/java/jdk1.8.0_101/bin/../jre/bin/server;F:/e/java/jdk1.8.0_101/bin/../jre/bin;F:/e/java/jdk1.8.0_101/bin/../jre/lib/amd64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;F:\e\java\jdk1.8.0_101\bin;C:\Program Files\TortoiseSVN\bin;E:\apache-ant-1.9.6\bin;C:\Program Files\Git\cmd;F:\e\maven\apache-maven-3.2.5\bin;F:\e\eclipse\sts-3.8.1.RELEASE;;. java.specification.name: Java Platform API Specification java.class.version: 50.0 sun.management.compiler: HotSpot Client Compiler os.version: 6.1 org.apache.catalina.startup.ContextConfig.jarsToSkip: user.home: C:\Users\wl catalina.useNaming: true user.timezone: Asia/Shanghai java.awt.printerjob: sun.awt.windows.WPrinterJob file.encoding: Cp1252 java.specification.version: 1.6 catalina.home: F:\e\tomcat\apache-tomcat-7.0.70 java.class.path: F:\e\tomcat\apache-tomcat-7.0.70\bin\bootstrap.jar;F:\e\tomcat\apache-tomcat-7.0.70\bin\tomcat-juli.jar;E:\Oracle\jdk1.6.0_24_x64\lib\tools.jar user.name: wl java.naming.factory.initial: org.apache.naming.java.javaURLContextFactory package.definition: sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.jasper.,org.apache.naming.,org.apache.tomcat. java.vm.specification.version: 1.0 sun.java.command: org.apache.catalina.startup.Bootstrap start java.home: E:\Oracle\jdk1.6.0_24_x64\jre sun.arch.data.model: 32 user.language: en java.specification.vendor: Sun Microsystems Inc. awt.toolkit: sun.awt.windows.WToolkit java.vm.info: mixed mode java.version: 1.6.0_45 java.ext.dirs: E:\Oracle\jdk1.6.0_24_x64\jre\lib\ext;C:\Windows\Sun\Java\lib\ext sun.boot.class.path: E:\Oracle\jdk1.6.0_24_x64\jre\lib\resources.jar;E:\Oracle\jdk1.6.0_24_x64\jre\lib\rt.jar;E:\Oracle\jdk1.6.0_24_x64\jre\lib\sunrsasign.jar;E:\Oracle\jdk1.6.0_24_x64\jre\lib\jsse.jar;E:\Oracle\jdk1.6.0_24_x64\jre\lib\jce.jar;E:\Oracle\jdk1.6.0_24_x64\jre\lib\charsets.jar;E:\Oracle\jdk1.6.0_24_x64\jre\lib\modules\jdk.boot.jar;E:\Oracle\jdk1.6.0_24_x64\jre\classes server.loader: java.vendor: Sun Microsystems Inc. catalina.base: F:\e\workspaceflex\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 file.separator: \ java.vendor.url.bug: http://java.sun.com/cgi-bin/bugreport.cgi common.loader: ${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar sun.io.unicode.encoding: UnicodeLittle sun.cpu.endian: little wtp.deploy: F:\e\workspaceflex\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps package.access: sun.,org.apache.catalina.,org.apache.coyote.,org.apache.jasper.,org.apache.naming.resources.,org.apache.tomcat. sun.desktop: windows sun.cpu.isalist: pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86