tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hassan Schroeder <hassan.schroe...@gmail.com>
Subject Re: Static files with default servlet in tomcat 8.0.9
Date Mon, 12 Jan 2015 16:46:35 GMT
On Mon, Jan 12, 2015 at 6:55 AM, Srikanth Hugar
<srikanth.hugar@gmail.com> wrote:

>    I am trying to configure static files with default servlet in tomcat
> 8.0.9 but could not succeed.
>
> My directory structure in deployed webapp is:
>
> - WEB-INF
> - static
>      -css
>      -images
>      -js
> - META-INF
>
> and* web.xml* configuration using default servlet is :
>
>   <!-- static URLs -->
>     <servlet-mapping>
>         <servlet-name>default</servlet-name>
>         <url-pattern>/res/*</url-pattern>
>     </servlet-mapping>

The default servlet will handle your static resources out of the box.

Get rid of the above (/res/*) mapping and access as e.g.
  /myapp/static/js/imports/jquerymin.js

-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message