Jsp (preferred for SUN Enterprise applications), relative paths and absolute paths in Servlet
Jsp (preferred for SUN Enterprise applications)AndServletThe absolute path and Relative Path Problems have plagued me for several days. After some efforts, I will share some of my experiences with you.
Premise: assume that yourHttpThe address isHttp: // 192.168.0.1/YourWebThe application isWebapp, Then yourWebApplicationURLIsHttp: // 192.168.0.1/webapp/
WebApplication directory structure:
Webapp/
Web-inf/
Classes/
Lib/
Web. xml (standardization is getting closer and closer)
<Servlet-mapping>
<Servlet-name> handleservlet </servlet-name>
<Url-pattern>/handleservlet </url-pattern>This ing is relative to the currentWebApplication
</Servlet-mapping>
User/
A. jsp (preferred for SUN Enterprise applications)
B. jsp (preferred for SUN Enterprise applications)
Images/
Css/
Js/
All relative paths are composed of