The Web. XML is configured as
<?xml version= "1.0" encoding= "UTF-8"? ><web-app xmlns= "http://xmlns.jcp.org/xml/ns/ Java EE " xmlns:xsi=" http://www.w3.org/2001/ Xmlschema-instance " xsi:schemalocation=" http// Xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd " version= "3.1" > <context-param> <!--configure the name and path of the spring configuration file--> < param-name>contextconfiglocation</param-name> < Param-value>classpath:applicationcontext.xml</param-value> </context-param > <!--start the servletcontextlistener--> of the Spring's own IOC container <listener> <listener-class>org.springframework.web.context.contextloaderlistener</ Listener-class> </listener></web-app>
Similarly configured beans are identical to the implementation of the previous simulation
Do not test the servlet this time, embed the code directly in The. JSP
<%@ page contenttype= "text/html;charset=utf-8" language= "java"%>
The side of the direct write application didn't read it.
This article is from the "small and small white" blog, please be sure to keep this source http://malin.blog.51cto.com/10779111/1842925
Using Spring's own listener for Web configuration