问题描述
问题是:Configurationproblem:UnabletolocateSpringNamespaceHandlerforXMLschemanamespace[http://www.springframework.org/schema/context]Offendingresource:ServletContextresource[/WEB-INF/context/applicationContext.xml]这是spring的application。xml:<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:flex="http://www.springframework.org/schema/flex"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/flexhttp://www.springframework.org/schema/flex/spring-flex-1.0.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-2.5.xsd"><context:property-placeholderlocation="classpath:../properties/loginTest.properties"/><beanid="userLogin_user"class="org.apache.commons.dbcp.BasicDataSource"destroy-method="close"><propertyname="driverClassName"value="com.mysql.jdbc.Driver"/><propertyname="url"value="${db-user.url}"/><propertyname="initialSize"value="${db-user.initial-pool-size}"></property><propertyname="username"value="${db-user.username}"/><propertyname="password"value="${db-user.password}"/><propertyname="poolPreparedStatements"value="true"/><propertyname="validationQuery"value="select1"/><propertyname="maxWait"value="10000"/><propertyname="maxActive"value="50"/><propertyname="maxIdle"value="-1"/></bean><beanid="userdao"class="UserDao"factory-method="getInstance"><propertyname="dataSourceUser"ref="userLogin_user"/></bean></beans>web.xml是:<?xmlversion="1.0"encoding="UTF-8"?><web-appversion="2.5"xmlns="http://java.sun.com/xml/ns/javaee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"><!--连接池配置begins--><resource-ref><description>DBConnection</description><res-ref-name>jdbc/userinfo</res-ref-name><res-type>javax.sql.DataSource</res-type><res-auth>Container</res-auth></resource-ref><!--连接池配置end--><!--springbegin--><context-param><param-name>contextConfigLocation</param-name><param-value>/WEB-INF/context/*.xml;</param-value></context-param><servlet><servlet-name>SpringContextServlet</servlet-name><servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class><load-on-startup>1</load-on-startup></servlet><!--springend--><servlet><description>ThisisthedescriptionofmyJ2EEcomponent</description><display-name>ThisisthedisplaynameofmyJ2EEcomponent</display-name><servlet-name>LoginServlet</servlet-name><servlet-class>LoginServlet</servlet-class></servlet><servlet-mapping><servlet-name>LoginServlet</servlet-name><url-pattern>/loginServlet</url-pattern></servlet-mapping><welcome-file-list><welcome-file>index.jsp</welcome-file></welcome-file-list></web-app>帮帮忙谢谢!
解决方案
解决方案二:
谢谢各位,帮帮忙!
解决方案三:
绝对给分!快帮帮忙!