第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

springmvc使用表單標(biāo)簽報(bào)異常

springmvc使用表單標(biāo)簽報(bào)異常

讀者123 2017-05-07 23:01:33
springmvc使用表單標(biāo)簽報(bào)異常:java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?引用了:<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>再使用:“<form:form action="addStudent" method="post"> <form:label path="name">姓名:</form:label><form:input path="name"/> <form:textarea path="text"/></form:form>”就報(bào)異常,求助。 如果不使用 上面的spring 的form 標(biāo)簽就不報(bào)錯(cuò)。web.xml:<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <servlet> <servlet-name>SpringMVC</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>SpringMVC</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list></web-app>WEB-INF 目錄下有SpringMVC-servlet.xml:<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="? ? ? ? http://www.springframework.org/schema/beans?? ? ? ? http://www.springframework.org/schema/beans/spring-beans-3.0.xsd? ? ? ? http://www.springframework.org/schema/context?? ? ? ? http://www.springframework.org/schema/context/spring-context.xsd? ? ? ? http://www.springframework.org/schema/mvc? ? ? ? http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"> <context:component-scan base-package="test2" /> ? </beans>
查看完整描述

1 回答

?
younghu

TA貢獻(xiàn)25條經(jīng)驗(yàn) 獲得超6個(gè)贊

<servlet>
<servlet-name>SpringMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>SpringMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

這個(gè)配置錯(cuò)誤,加上一個(gè)

<servlet>
????<servlet-name>SpringMVC</servlet-name>
????<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
????<init-param>
??????<param-name>contextConfigLocation</param-name>
??????<param-value>classpath:xxx.xml</param-value>
????</init-param>
????<load-on-startup>1</load-on-startup>
??</servlet>
??<servlet-mapping>
????<servlet-name>SpringMVC</servlet-name>
????<url-pattern>/</url-pattern>
??</servlet-mapping>

你配置文件少了一個(gè)contextConfigLocation

查看完整回答
反對(duì) 回復(fù) 2017-05-08
  • 1 回答
  • 0 關(guān)注
  • 3176 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)