티스토리 뷰

1. pom.xml에서 JDK와 Servlet의 버전을 각각 1.8과 3.1.0으로 변경 후 저장한 다음 "프로젝트 우클릭 → Maven → Update Project..."

<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <maven.compiler.source>1.8</maven.compiler.source>
  <maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>javax.servlet-api</artifactId>
  <version>3.1.0</version>
  <scope>provided</scope>
</dependency>

 

2. web.xml에 DTD를 3.1로 변경한다.

<?xml version="1.0" encoding="UTF-8"?>
<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">
 <display-name>Archetype Created Web Application</display-name>
 <welcome-file-list>
     <welcome-file>index.html</welcome-file>
     <welcome-file>index.jsp</welcome-file>
 </welcome-file-list>
</web-app>

 

3. 이클립스 Navigator 뷰에서 프로젝트/.settings/org.elclipse.wst.common.project.facet.core.xml 파일을 수정한다.

<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.8"/>
<installed facet="jst.web" version="3.1"/><!-- 2.3에서 3.1로 변경 -->
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>

 

4. 이클립스 restart

'Language > Java' 카테고리의 다른 글

for-each / Iterator  (0) 2021.02.18
Arrays / Collections  (0) 2021.02.18
Servlet 버전별 작성 방법  (0) 2021.01.05
try - with - resources 문을 이용한 예외 처리  (0) 2020.12.21
JDBC 설정  (0) 2020.12.21
댓글
Total
Today
Yesterday
링크
Apple 2023 맥북 프로 14 M3, 스페이스 그레이, M3 8코어, 10코어 GPU, 512GB, 8GB, 한글