English 中文(简体)
三. 编外的其他环境:长期目标
原标题:Additional context for tomcat:run goal

我如何在目录上增加一个基于目录的目录:格式?

我有以下喷气花板组合:

<build>
  <plugins>
    <plugin>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>maven-jetty-plugin</artifactId>
      <configuration>
        <contextHandlers>
          <contextHandler implementation="org.mortbay.jetty.handler.ContextHandler">
            <contextPath>/media/data</contextPath>
            <resourceBase>/somedir/media/data</resourceBase>
            <handler implementation="org.mortbay.jetty.handler.ResourceHandler" />
          </contextHandler>
        </contextHandlers>
        <contextPath>/</contextPath>
        <webAppSourceDirectory>foo-project/target/foo-webapp</webAppSourceDirectory>
...
      </configuration>
    </plugin>
  </plugins>
...
</build>

我如何这样做?

我有一个背景。

<?xml version= 1.0  encoding= utf-8 ?>
<Context path="/media" docBase="/somedir/media"/>

but this seems to get ignored. I ve also tried to explicitly set the contextFile parameter in the plugin configuration, but to no avail.

Reference: http://mojo.codehaus.org/tomcat-maven-plugin/run-mojo.html

问题回答

查阅至mcat plugin。

将背景材料存档至违约地点

src/main/webapp/META-INF/context.xml

或使用散射线: 指挥线上的档案财产

mvn tomcat:run -DcontextFile="<path-to-your-context.xml-file>"




相关问题
Tomcat´s server.xml dynamic configuration

My web application uses the same database configuration as the application XYZ. I have a resource declaration for a context in server.xml, so I have a duplicated configuration (once for web ...

session transfer issue from Tomcat to ASP.Net

I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...

JSP exception - class not found (tomcat)

I m setting up an existing application on a new Tomcat 5.5 server connecting to a Postgres database (running on Debian Lenny). When I access it I get a series of stack traces with the following root ...

热门标签