Can't access static resources (.html) files in Apache Tomcat 7.0.52 -
even though found similar queries on topic can't find answer suitable problem. requirement follows -
i have installed app (myapp) in webapps dir of apache tomcat ver 7 web server. dir structure
/ | |----api/ | |----web-inf/ | |----meta-inf/
i have static html files in "api" dir(say index.html) want access in following way through browser - http://localhost:8080/myapp/api/index.html
however, can't access static resources (html files) in way. far know static outside web-inf can accessed directly through browser can't it.
my web.xml looks -
<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0"> <display-name>myapp</display-name> <servlet> <servlet-name>jersey rest service</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.servletcontainer</servlet-class> <init-param> <param-name>javax.ws.rs.core.application</param-name> <param-value>com.mycomp.myapp</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>jersey rest service</servlet-name> <url-pattern>/myapp/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list>
i'll appreciate on this.
thanks.
try replacing value tag url-pattern different name /rest/* instead of myapp. try accessing url.
Comments
Post a Comment