46_Spring WEB
557
29 asked
Servlet의 버전을 3.1.0으로 올리니 아래와 같이 에러가 발생합니다.
Answer 4
1
올려주신 내용중 web.xml에 2군데가 중복인데 하나를 지워주셔야 됩니다.
2군데 라면 아래내용 빨강색을 지워주시고 다시 제가 설명한데로 해보시기 바랍니다.
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="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/javaee https://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
///////////////////////////////////////////////////////////////////////////////
제가 다시 강의에 올려져 있는 파일로 확인을 했는데 에러는 나지 않는데요.
다시한번 설명해보겠습니다.
1. pom.xml에 servlet 3.1.0 으로 API 변경 확인해주시구요.
<!-- servlet 3.1.0 으로 API 변경 -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
2. FileController.java 파일에서
1) import 부분에서 에러나는 부분을 삭제하시고
2)다시 HttpServletRequest에서 마우스를 올리시고 import를 해보시기기 바랍니다.
3. 이렇게 해도 에러가 없어지지 않으시면 첨부파일에 있는 파일을 import해서 진행해보시기 바랍니다.
0
혹시 web.xml 은 어떻게 수정하셨는지요? 한번 올려줘보세요.
0
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="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/javaee https://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
<!-- Character Encoding -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- The definition of the Root Spring Container shared by all Servlets
and Filters -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
<!-- Creates the Spring Container shared by all Servlets and Filters -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- Processes application requests -->
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
0
메이븐 업데이트 해도 아래와 같은 에러 메세지가 계속나오는데요 ㅠ.ㅠ
The method getServletContext() is undefined for the type HttpRequest
0
서블릿 버전을 변경하셨으면, web.xml도 수정하시고 프로젝트 clean, 메이븐 업데이트 해보시기 바랍니다.^^ 강의 영상에 변경방법이 설명되어 있을것입니다.
ping 연결관련
0
87
1
26강에서 member1에 사진 인서트할때 500 오류가 떠요
0
106
1
안녕하세요, Spring Legacy Project 생성 시 오류 문의드립니다.
0
348
1
32강 spring mvc 안보임
0
262
2
나프2탄 51강 서비스계층 구현하기
0
290
1
32강 WEB MVC프로젝트 만들기 01버전 질문입니다
0
326
1
27강 이미지업로드 질문입니다.
1
183
1
7강 mybatis 에러 질문 드립니다
0
306
1
32강 spring legacy project
0
521
3
마프시리즈가뭐에요??
0
380
1
Spring Legacy Project에 관하여
0
1221
2
뷰 <form => PostMapping 컨트롤러 VO(int 형) 받기 문의 드립니다
0
370
1
한글로 작성한 파일은 사진이 보이지 않습니다.
0
303
1
fileItem.getName().substring(idx+1) 사용 이유가 궁금합니다.
0
333
1
안녕하세요 맥북세팅 질문드려요
0
378
2
19강 ajax통신의 콜백 함수 인자에 대해
0
306
2
나프 2 19강에서 질문있습니다.
0
272
1
제이쿼리 코드지만!
0
321
1
파일 업로드 경로 문의
0
351
1
스프2탄이후 후속강의는 언제나와요?
0
330
1
MVC07 파일 업로드 부분 수강중인데 갑자기 mysql 쿼리가 느려졌습니다..
0
233
1
강의자료
0
440
1
강의 4분 7초, 11분 49초
0
361
1
강의 17:23초
0
321
1

