`

war包技巧 - META-INF/context.xml

阅读更多
Tomcat下war应用配置数据源又一方法
    把配置写于/META-INF/context.xml中,例:

<Context path="/axis2" privileged="true" antiResourceLocking="false" antiJARLocking="false">
    <ResourceLink
             name="jdbc/BPMSDB"
             global="BPMSDB"
             type="javax.sql.DataSource"
             />
</Context>

查看定义文件,comtext在tomcat5.5中可出现的位置有:

  • in the $CATALINA_HOME/conf/context.xml file: the Context element information will be loaded by all webapps
  • in the $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default file: the Context element information will be loaded by all webapps of that host
  • in individual files (with a ".xml" extension) in the $CATALINA_HOME/conf/[enginename]/[hostname]/ directory. The name of the file (less the .xml) extension will be used as the context path. Multi-level context paths may be defined using #, e.g. context#path.xml. The default web application may be defined by using a file called ROOT.xml.
  • if the previous file was not found for this application, in an individual file at /META-INF/context.xml inside the application files
  • inside a Host element in the main conf/server.xml
分享到:
评论

相关推荐

    apache-solr-ref-guide-5.2.1用户手册与搭建指南.rar

    创建JNDI让程序找到solr/home(当然你也可以用System Properties方式), 在WebRoot/META-INF目下创建context.xml 文件,并写入以下字符 &lt;?xml version='1.0' encoding='utf-8'?&gt; &lt;Context&gt; ...

    基于MyEclipse搭建maven+springmvc整合图文教程(含源码0

    在pom.xml中添加所需要的jar包 使用Maven POM editor打开项目中的pom.xml文件,选择Dependencies,在Dependencies栏目点击Add进行,首先弹出一个搜索按钮,例如输入spring-web,就会自动搜索关于spring-web相关的jar...

    solr-5.2.1.part1.rar 编译第1部分,共2部分

    创建JNDI让程序找到solr/home(当然你也可以用System Properties方式), 在WebRoot/META-INF目下创建context.xml 文件,并写入以下字符 &lt;?xml version='1.0' encoding='utf-8'?&gt; &lt;Context&gt; ...

    solr-5.2.1.part2.rar 编译 第2部分,共2部分

    创建JNDI让程序找到solr/home(当然你也可以用System Properties方式), 在WebRoot/META-INF目下创建context.xml 文件,并写入以下字符 &lt;?xml version='1.0' encoding='utf-8'?&gt; &lt;Context&gt; ...

    solr-5.2.1-src.tgz源码

    创建JNDI让程序找到solr/home(当然你也可以用System Properties方式), 在WebRoot/META-INF目下创建context.xml 文件,并写入以下字符 &lt;?xml version='1.0' encoding='utf-8'?&gt; &lt;Context&gt; ...

    基于Java web的自动化办公系统设计与实现(源码+数据库).zip

    或者在WebContent/META-INF/context.xml 修改数据库的连接。 开发者请用eclipse导入此项目,使用者把LeyeOA.war放入Tomcat7\webapps 在浏览器输入http://localhost:8080/LeyeOA/ 初始用户名密码 administrator ...

    rhizomer:Rhizomer是一个Web应用程序,可促进语义数据的发布,查询,浏览,编辑和交互

    如果安装在其他位置,则应仅调整META-INF / context.xml文件(当前为“ webapps / rhizomer / META-INF / users.xml”)中users.xml文件的路径。 只有一个默认用户,名为“ rhizomer”,密码为“ rhizomer”。 基本...

    activiti-explorer for5.2

    这是activiti-5.20.0版本的activiti-explorer,数据源改为了JNDI,数据库部署好之后,把本war包放到tomcat里面,然后修改activiti-explorer\META-INF\context.xml里面的数据库配置。

    java web课程设计学生评教系统

    项目描述 此项目是java web的一个课程设计,基本完成了所有功能,基于bootstrap框架写的 运行环境 jdk7+tomcat7+mysql+...1.务必把Education_system\WebRoot\META-INF\context.xml也需要发布,否则找不到jndi数据源

    activiti-explorer

    这是activiti-5.20.0版本的activiti-explorer,数据源改为了JNDI,数据库部署好之后,把本war包放到tomcat里面,然后修改activiti-explorer\META-INF\context.xml里面的数据库配置。

Global site tag (gtag.js) - Google Analytics