Reputation: 1495
I want to access file (for example from http://localhost:8080/myweb/styles.css
), but i dont want to write servlet for each static file on my web. Is there any way how to access that file without servlet? I am using tomcat 7.
Upvotes: 0
Views: 49
Reputation: 115328
You do not have to write servlet for this. All files located in root of your web application are accessible via HTTP.
For example if your web application has only one file styles.css
, i.e. you have folder myweb
that contains this file under $TOMCAT_HOME/webapps
it is accessible automatically.
Upvotes: 1