* 본 글은 [뉴렉처]의 Servlet&JSP 프로그래밍 강의를 듣고 정리한 글입니다.
2020 Servlet&JSP 프로그래밍
www.youtube.com
서블릿 프로젝트의 web.xml에서 발생하는 오류 해결
- Dynamic Web Project 생성하고 조금 기다리면 WebContent>WEB-INF>web.xml에 오류 발생
- <web-app>태그의 속성 xsi:schemaLocation=”http://xmlns … .xsd”에 노란줄이 뜸 (인식이 안 되고 있다는 의미)
- .xsd를 읽을 수 없는 이유
- 현재는 https 프로토콜을 쓰는데 해당 파일에 http 프로토콜을 사용해서 오류가 난 것
- .xsd 파일은 스키마 파일의 .xml을 정의하는 파일 (.xml 파일에서 사용하는 태그들의 순서, 중첩관계를 정의해 태그들의 유효성을 판단)
- 해결 방법
- <web-app>태그의 속성 xsi:schemaLocation=”http://xmlns … .xsd”에서, http를 https로 바꿔주면 오류 해결
<web-app xmlns="https://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://xmlns.jcp.org/xml/ns/javaee
https://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0"
metadata-complete="true">
'☕ Java 웹 프로그래밍 > Servlet & JSP' 카테고리의 다른 글
[Servlet&JSP] 어노테이션을 이용한 URL 매핑 (0) | 2023.05.23 |
---|---|
[Servlet&JSP] 이클립스를 이용한 서블릿 프로그래밍 (0) | 2023.05.23 |
[Servlet&JSP] 웹 개발을 위한 이클립스 IDE 설치하기 (0) | 2023.05.23 |
[Servlet&JSP] Servlet 문자열 출력 (0) | 2023.05.23 |
[Servlet&JSP] 서블릿 객체 생성과 실행 (0) | 2023.05.23 |