5

I am deploying a simple web module to glassfish server.

The package name is test2.war.

The runtime deployment descriptor file sun-web.xml specifies the Context Root as below:

  <context-root>/myTest</context-root>

According to the Java EE 5 tutorial, A context root identifis a web application in a Java EE server. I expected that I should visit my site like below:

http://localhost:8080/myTest

But it turns out I still have to use:

http://localhost:8080/test2

So what's the purpose of Context Root? How to use it?

ADD 1

According to Setting context root does not work in Glassfish

This seems to be a glassfish bug.

Community
  • 1
  • 1
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
  • 1
    This may contain the solution: http://stackoverflow.com/questions/16216323/using-the-context-root-from-glassfish-web-xml-in-glassfish-3 – PeterMmm Jan 22 '15 at 07:23
  • well, does the sun-web.xml is still supported (and loaded) in a glassfish server? Haven't seen such files in apps for some time... – maslan Jan 22 '15 at 07:26
  • @PeterMmm Thanks. I followed that thread and turn to use `glassfish-web.xml`. It works now. – smwikipedia Jan 22 '15 at 08:02
  • @maslan I am new to Java. Maybe I am not reading the latest info. – smwikipedia Jan 22 '15 at 08:02

0 Answers0