Question

I'm using maven and jetty for my web application. I give the command mvn jetty:run to run the maven/jetty which also will load my web application. But the path I get to use to access is http://localhost:8080/filename.jsp while I want it to be http://localhost:8080/myappname/filename.jsp

How to get this done ? Please let me know if I've to post specific files from my web app for you to be able to solve this.

I found other way around at Remove application name after localhost in jetty

Était-ce utile?

La solution

From these docs: http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html#jetty-run-goal

I think you just need to configure the contextPath in your pom.xml:

<plugin>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <configuration>
    <scanIntervalSeconds>10</scanIntervalSeconds>
    <webApp>
      <contextPath>/test</contextPath>
    </webApp>
  </configuration>
</plugin>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top