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

migrate from weblogic to tomcat: directory mapping--reference的更多相关文章

  1. 浅谈WebLogic和Tomcat

    J2ee开发主要是浏览器和服务器进行交互的一种结构.逻辑都是在后台进行处理,然后再把结果传输回给浏览器.可以看出服务器在这种架构是非常重要的. 这几天接触到两种Java的web服务器,做项目用的Tom ...

  2. WebLogic和Tomcat的区别

    J2ee开发主要是浏览器和服务器进行交互的一种结构.逻辑都是在后台进行处理,然后再把结果传输回给浏览器.可以看出服务器在这种架构是非常重要的. 这几天接触到两种Java的web服务器,做项目用的Tom ...

  3. WebLogic和Tomcat

    J2ee开发主要是浏览器和服务器进行交互的一种结构.逻辑都是在后台进行处理,然后再把结果传输回给浏览器.可以看出服务器在这种架构是非常重要的. 这几天接触到两种Java的web服务器,做项目用的Tom ...

  4. 浅谈weblogic与tomcat的区别

    weblogic是用于开发.集成.部署和管理大型分布式web应用.网络应用和数据库应用的java应用服务器,将java的动态功能和java enterprise标准的安全性引入大型网络应用的开发集成部 ...

  5. Three Steps to Migrate Group Policy Between Active Directory Domains or Forests Using PowerShell

    Three Steps Ahead Have you ever wished that you had three legs? Imagine how much faster you could ru ...

  6. file-leak-detector(文件句柄泄漏)在JDK1.6环境下 weblogic 和 tomcat安装方式以及使用方式

    file-leak-detector作者博客详见: http://file-leak-detector.kohsuke.org/ file-leak-detector学习贴: https://blog ...

  7. 【转】Tomcat和Weblogic的区别

    J2ee开发主要是浏览器和服务器进行交互的一种结构.逻辑都是在后台进行处理,然后再把结果传输回给浏览器.可以看出服务器在这种架构是非常重要的. 这几天接触到两种Java的web服务器,做项目用的Tom ...

  8. web容器(weblogic、resin、tomcat、jboss对比)

    WebLogic 12c Linux静默安装 weblogic11g 密码忘记解决方案 glassfish和tomcat各自的优势和劣势 Linux Resin4.0 安装配置(优质) 对比 . we ...

  9. tomcat迁移到weblogic的几个问题

    第1个问题: 异常描述:VALIDATION PROBLEMS WERE FOUND problem: cvc-enumeration-valid: string value '3.0' is not ...

随机推荐

  1. OC学习总结之面向对象和类

    OC学习总结之面向对象和类   Objective-c是c语言的母集合,它的原意就是在原始的c语言的主体上加入面向对象的特性.1.面向对象和面向过程  面向对象和面向过程是编程的两种思考方式.面向对象 ...

  2. iOS题

    对于语句NSString* testObject = [[NSData alloc] init];关于testObject是什么类型对象,以下说法正确的是: 答案:(A) A.编译时,NSString ...

  3. codeforces D. Painting The Wall

    http://codeforces.com/problemset/problem/399/D 题意:给出n和m,表示在一个n*n的平面上有n*n个方格,其中有m块已经涂色.现在随机选中一块进行涂色(如 ...

  4. DB2 SQL RR/RS/CS/UR四个级别《转载》

    1.RR隔离级别:在此隔离级别下, DB2会锁住所有相关的纪录.在一个SQL语句执行期间,所有执行此语句扫描过的纪录都会被加上相应的锁.具体的锁的类型还是由操作的类型来决定,如果是读取,则加共享锁:如 ...

  5. 稍加详细的ATR信息,将完善历史字节部分+

    http://blog.csdn.net/jennyvenus/article/details/2900697 //Reset 3B FB 13 00 00 81 31 FE 45 65 46 53 ...

  6. TinyMCE下载及使用

    1.TinyMCE下载 官方下载网址:http://www.tinymce.com/ 简体中文语言包下载:http://www.tinymce.com/i18n/index.php?ctrl=lang ...

  7. 转:阿里旺旺导致python安装包失败的解决办法

    我以前使用web.py没事,今天运行时报错, mimetypes.init() # try to read system mime.types File "D:\ProgramFiles\p ...

  8. 利用函数索引优化<>

    SQL> select count(*),ID from test_2 group by id; COUNT(*) ID ---------- ---------- 131072 1 11796 ...

  9. SQL Server判断对象是否存在 (if exists (select * from sysobjects )(转)

    1 判断数据库是否存在Sql代码 if exists (select * from sys.databases where name = ’数据库名’)    drop database [数据库名] ...

  10. 字符串(后缀自动机):Codeforces Round #129 (Div. 1) E.Little Elephant and Strings

    E. Little Elephant and Strings time limit per test 3 seconds memory limit per test 256 megabytes inp ...