I am trying to migrate from weblogic to tomcat. in weblogic I have
For example I have mysite project. It means that localhost:8080/mysite/ = E:/internal and I can get a file from E:/internal through localhost:8080/mysite/
I whole project is used:
In this article there is an examle how to map local folder to tomcat.
This 6. Now inside the above xml file put the following line: <context docbase="d:/images"></context>
doesnt work for me. I changed it to
(1) <Context docBase="E:/internal"></Context>
It works. But I have a problem. For example I have localhost:8080/mysite/about page.
When I use (1) mapping
src="<%=request.getContextPath()%>/file.jsp" doesnt work because it returns mysite/file.jsp
when I try to map mysite by creating mysite.xml the project is not starting because mysite is a site url.
How can I resolve this problem?
The best thing is probably to map each item in
E:\Internal individually using the
aliases attribute of your
<Context> (see http://tomcat.apache.org/tomcat-7.0-doc/config/context.html). Note that using
/ as an "alias path" is not allowed, which is why you'd have to map each item in
It would be better if you could use a particular URL space for
/internal/[something] and map the whole directory as an
alias, but that might not be feasible for your project.
If you really want to "merge" the two directories (that is, resources from both
CATALINA_BASE/webapps/mysite are available via URLs like
/mysite/foo, then you will have to use the VirtualDirContext like this:
<Context> <Resources className="org.apache.naming.resources.VirtualDirContext" extraResourcePaths="/=E:\Internal" /> </Context>