반응형
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<link href="<%=request.getContextPath()%>/resources/css/styles.css">
<script
src="<%=request.getContextPath()%>/resources/js/dashboard/dashboard.js"></script>
<!-- request.getContextPath는 webapp의 경로이다. -->
이클립스 server.xml 에서 port=8080과 port=8009 두 개의 connector에 URIEncoding="UTF-8"을 추가한다.
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URLEncoding="UTF-8"/>
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URLEncoding="UTF-8"/>
request.setCharacterEncoding("UTF-8")
response.setCharacterEncoding("UTF-8")
response.setContentType("text/html; charset=utf-8")
반응형
'[Java] > [JSP, Servlet]' 카테고리의 다른 글
[JSP, Servlet] HttpServletRequest HttpServletResponse (0) | 2022.10.10 |
---|---|
[JSP, Servlet] html파일을 jsp 변환시 깨짐 방지하는 방법 (0) | 2021.10.24 |
[JSP, Servlet] JSTL 표준 태그 라이브러리 (0) | 2021.08.09 |
[JSP, Servlet] EL(표현 언어) (0) | 2021.08.09 |
[JSP, Servlet] DB연결 (JDBC, ResultSet, executeQuery, executeUpdate) (0) | 2021.07.30 |