1
votes

While configuring a maven application in Eclipse I can add a static folder to Tomcat Server. This static folder contains properties and config files used by the web application, even images and css files.

Unfortunatelly I can't move it to the web application resources folder because it's a legacy application.

My company is changing the IDE from eclipse to Netbeans and I'm concerned if there is a way to add this static folder in Netbeans's embedded Tomcat. Is it possible?

By the way, we're using Netbeans 7.1.2 and Apache Tomcat 7.0.22.0 with java 1.6.0_26.

2
can you show the folder structure in your eclipse project?gigadot
@gigadot, it's a maven default structure. But our static folder is in another folder outside the project's folder.Adriano Castro
The only option i can find is Tools->Servers->select your tomcat->Sources tab->Add folder, but i'm not sure if that is what you are looking for.gigadot
@gigadot, thanks, but it's not what I need. I need to add an external folder to the application's classpath.Adriano Castro

2 Answers

1
votes

Try: Tools -> Options -> Java -> Ant tab -> in the "Classpath" section add your static folder by clicking on "Add Directory" button.

Yesterday I had similar problem, and this worked for me.

0
votes

I solved it by opening /conf/server.xml file and adding this line:

<Context docBase="C:/static" path="/static" reloadable="true"/>

Now, a file inside C:/static which name is test.jpg can be acessed through localhost:8080/static/test.jpg.

Thanks.