1

My jetty context xml looks like:

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  **<Set name="contextPath">/</Set>**
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/../core.war</Set>
</Configure>

My rail server talks to jetty. However, the I get some "server errors"

But when I change the contextPath as follows, then it works:

  **<Set name="contextPath">/foo</Set>**

Could you please tell me why root context is not working?

GJain
  • 5,025
  • 6
  • 48
  • 82

1 Answers1

1

try naming it root.xml and your war file root.war

jesse mcconnell
  • 7,102
  • 1
  • 22
  • 33
  • just a common naming convention, if it is foo.war then it defaults to foo context with servlets inside matching / and servlet/...and if you use root.war then that implies to the container it should serve root content, otherwise you get a list of the deployed webapps – jesse mcconnell Nov 07 '13 at 16:37
  • http://wiki.eclipse.org/Jetty/Howto/Deploy_Web_Applications (need to sort out why I don't see this in the 9 docs atm) – jesse mcconnell Nov 07 '13 at 16:37
  • I only have the high level view of error which is "accessing http://localhost:8080/resources gives 404 - Not found error" but if I add /foo to contextPath and access http://localhost:8080/foo/resources then everything works as expected. Jetty Logs do not seem to indicate any error – GJain Nov 07 '13 at 17:24