Hi all,
I have a simple EAR and WAR project. My WAR project web.xml looks some like this..
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Sample</display-name>
<servlet>
<servlet-name>test</servlet-name>
<servlet-class>com.sample.TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
</web-app>
When i tried to deploy the above Application in WAS 7.0 using Exploded (Classic) style.
Everything looks fine, but when browse the deplyment folder, i failed to find the tag <display-name> in the web.xml. The above web.xml looks likes this after deployment.
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<servlet-name>test</servlet-name>
<servlet-class>com.sample.TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
</web-app>
Hence the API call ServletContext.getServletContextName() does not yield correct result.
This works correct in all other mode.
I’m using MyEclipse 8.5, Build id: 8.5-Blue-20100319 and WAS 7.0