zoukankan      html  css  js  c++  java
  • migrate from weblogic to tomcat: directory mapping--reference

    Question:

    I am trying to migrate from weblogic to tomcat. in weblogic I have

    <virtual-directory-mapping>
      <local-path>E:/internal</local-path>

    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/

    localhost:8080/mysite/file.jsp

    I whole project is used:

    src="<%=request.getContextPath()%>/file.jsp"

    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?

    Answer:

    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 E:Internalindividually.

    It would be better if you could use a particular URL space for E:Internal like /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 E:Internal and 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>

    (See http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Virtual_webapp andhttp://tomcat.apache.org/tomcat-7.0-doc/config/resources.html#VirtualDirContext_implementation).

    原文地址:http://stackoverflow.com/questions/20400465/migrate-from-weblogic-to-tomcat-directory-mapping

  • 相关阅读:
    Git之GitFlow工作流
    auth
    rbac
    修改或删除windows上的git用户凭证信息
    Linux之shell备份数据库
    解决Navicat 连接服务器数据库报10060问题
    PHP框架学习思路
    shell之hello world
    Linux命令大全
    PHP 各个版本的区别
  • 原文地址:https://www.cnblogs.com/davidwang456/p/3907333.html
Copyright © 2011-2022 走看看