In a packaged web module for deployment on the Enterprise Server, the context root is stored in sun-web.xml.
To edit the context root, do the following:
Expand your project tree in the Projects pane of NetBeans IDE.
Expand the Web Pages and WEB-INF nodes of your project.
In the editor pane, click Edit As XML.
Edit the context root, which is enclosed by the context-root element.