Local Tomcat instance to recognize external docRoot
I have some image files that are stored outside my webapp, and my Tomcat (5.x) is configured to see them using the config file in the /conf/Catalina/localhost folder, like this:
]]>
The application JSPs access the images like this:
<img src="/img/subfolder/someimage.gif" ...
When I launch Tomcat outside intelliJ, the application finds all images just fine. However, when I launch Tomcat from IDEA (using a local configuration), the application has no access to the additional context definition with the docBase for the "/img" path. I can't figure out how to configure IntelliJ to recognize that. Could someone please help???
Thanks!
请先登录再写评论。
IDEA doesn't deploy applications from
]]>/conf/Catalina/localhost to Tomcat. So you should either
add {$some_home}/img folder into Resource roots list of your Web facet
or create new Web facet, add this folder to Resource roots list and mark
the facet for deployment in the run configuration.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Thanks for the reply! I'm all set now.
Hi,
I am stuck with the same issue here.
I am using IntelliJ Idea 8, Tomcat 5x.
I have made an external folder C:/uploads/images and C:/uploads/docs where in the uploads images and documents are stored.
When I start Tomcat from the command line i.e. startup.bat, the images can be accessed in the normal way like "http://locahost:8080/images/user1.jpg".
<Context path="/uploads" docBase="C:\uploads\" crossContext="true"/>
is the content of the xml file which I created and saved under C:\Tomcat\conf\Catalina\localhost
But the funny thing is that when I start Tomcat from IntelliJ Idea, it shows up
"HTTP 400 Bad Request"
How do I make this uploads directory accessible from my application.
Please help !
Regards,
broshni