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. WF学习笔记(一)

    -流程启动方式1: WorkflowInvoker.Invoke(new Workflow1()); -流程启动方式2: WorkflowApplication instance = new Work ...

  2. 全部与精简切换显示jQuery实例教程

    下面是某网站上的一个品牌列表展示效果,用户进入页面时,品牌列表默认是精简显示的(即不完整的品牌列表)效果如下图所示: 用户可以单击商品列表下方的“显示全部品牌”按钮来显示全部的品牌.单击“显示全部品牌 ...

  3. 装了SVN,你的关联图标变了没有?

    装了SVN,你的关联图标变了没有? 开始合作之后,装上了SVN,非常高效,我在VS写了一部分的代码,上传之后,别人通过下载或是更新,就更新到了合作同伴的VS里,相当于大家在一个VS里写代码.和保强他们 ...

  4. Android单元测试初探——Instrumentation(转载)

    学习Android有一段时间了,虽然前段时间对软件测试有了一些了解,不过接触android的单元测试却是头一次.这几天在物流大赛上也用了不少时间,所以对于android的单元测试没有太深入的研究,所以 ...

  5. Android 常用系统控件

    1. 日期选择器 DatePickerDialog 2. 时间选择器 TimePickerDialog 3. 单选按钮 RadioButton 4. 多选按钮 CheckBox 5. 下拉列表 Spi ...

  6. 关于DEDECMS自定义模型当中添加自定义字段后在后台添加内容后不显示解决方案

    用DEDECMS的时间也不长,最近在做一个站时,就遇到了这个问题(自定义字段在后台不显示内容)中添加自定义字段后在后台编辑打开后发现我之前添加的内容不显示,如果是只是看看不单击确定的话,那么在前台数据 ...

  7. 转:推荐!国外程序员整理的 C++ 资源大全

    原文来自于:http://blog.jobbole.com/78901/ 关于 C++ 框架.库和资源的一些汇总列表,由 fffaraz 发起和维护. 内容包括:标准库.Web应用框架.人工智能.数据 ...

  8. 单例模式在Unity中的应用

    起因:每个游戏场景中都会有许多的游戏对象,而各个游戏场景之间也是同等的关系.如何去管理它们,是我们要解决的问题. 场景中各脚本间的直接访问,会在各脚本间形成一个巨大而又混乱的网络,这给以后代码的维护带 ...

  9. 首页重定位到mian.action上

    <body onload="top.location.href='<%=request.getContextPath()%>/main.action';">

  10. SaaS是个不错的生意模式和创业的选择(独立SAAS厂商的三大优势)

    1. 软件独特而又强大,界面绝美2. 数据存在本国3. 数据不留底 4. 可随时寻求卖身或者合作,不受制于人 --------------------------------------------- ...