IT분야/Java
[JSP]JSTL 및 JSP 에서 공백 제거
suroMind
2013. 4. 4. 15:03
JSTL을 사용하여 forEach를 돌리고 웹브라우저에서 소스보기를 하면
상당히 많은 새로운 줄이 생기게 된다.
메인화면 같은 경우 기하급수적으로 늘어 몇천줄까지..
이를 없애주는 설정이 있다.
아래와 같이 web.xml에 추가해 주면 된다.
<!-- JSTL 사용시 공백 제거 -->
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<trim-directive-whitespaces>true</trim-directive-whitespaces>
</jsp-property-group>
</jsp-config>
출처 : http://blog.naver.com/PostView.nhn?blogId=hankk20&logNo=70120536752