Spring WEB.xml Start up Spring Engine Load it in Web.xml
Content about : Spring WEB.xml
Advertisements
After you made all of Class eg Hibernate ,DTO , Model ,Controller and made all of XML Configuration eg. Datasource XML ,Hibernate XML,Servlet XML you need to add all to Load it in WEB.xml Lest go to Start Spring Engine Now !!
Example Web.xml for Start Spring
<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app id=”WebApp_ID” version=”2.4″
xmlns=”http://java.sun.com/xml/ns/j2ee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xmlns:c=”http://java.sun.com/jsp/jstl/core”
xmlns:fmt=”http://java.sun.com/jsp/jstl/fmt”
xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”>
<display-name>EnterprisePT</display-name>
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>EnterprisePT.root</param-value>
</context-param>
<!– log4j configuration in web.xml –>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<!– /log4j configuration in web.xml END –>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/appcontext/datasource-service.xml
/WEB-INF/appcontext/dataAccesssContext-Hibernate.xml
/WEB-INF/appcontext/view-servlet.xml
/WEB-INF/appcontext/applicationCfxContext-WS.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/ws/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>appcontext/view</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appcontext/view</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>