일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 명령어
- cmd
- 다른사람 프로젝트 수정전 가져야할 자세
- 자바스크립트 인라인
- JSON
- 프로젝트 클린
- 타임리프
- Test 룸북 사용하기
- 시퀀스 조회
- StringUtils.hasText
- js
- 설정
- Intellij
- 리눅스
- linux
- 룸북
- BindingResult
- 스프링부트
- 함수 인자값 id
- select
- 하모니카 OS 5
- 추천 프로그램
- 타임리프와 스프링
- 개발시작전 자세
- Java
- 비밀번호 변경 명령어
- 추천 사이트
- it
- 순서 보장
- #{..}
Archives
- Today
- Total
웹개발 블로그
[JSP]JSP 공백 코드 제거(HTML 마크업 용량 다이어트) 본문
방법1. JSP 페이지 상단 적용
<%@page trimDirectiveWhitespaces="true" language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
방법2. build.gradle 일괄 적용
//JSP파일에서 공백 제거 속성(trimDirectiveWhitespaces) 일괄 적용
task addTrimDirectiveToJsp(type: Copy) {
from 'src/main/webapp/WEB-INF/jsp' // JSP 파일이 위치한 폴더
include '**/*.jsp'
into 'build/processedJsp'
eachFile { file ->
def fileContent = file.file.text
if (!fileContent.contains('trimDirectiveWhitespaces')) {
def newContent = '<%@ page trimDirectiveWhitespaces="true" %>\n' + fileContent
file.file.write(newContent)
}
}
}
processResources.dependsOn addTrimDirectiveToJsp
'◆JSP > 설정' 카테고리의 다른 글
view단에서 한글 깨짐 해결 방법(톰캣 : server.xml) (0) | 2023.03.21 |
---|---|
[IntelliJ-Spring 프로젝트] jsp수정 시 자동 리로드 (0) | 2023.01.21 |