1. jsp에서 xml형식으로 화면을 출력하기 위해서 xml선언문이 최 상단에 있어야 한다.

  디렉티브가 상단에 있을경우 출력시 에러 발생

  *디렉티브(Directive) : page, taglib, include


2. page contentType은 text/xml 이어야 한다.


3. 샘플 화면

1) 오류



2) 정상동작



*추가방법(JSP 2.1) jstl, Directive 공백 제거

1. web.xml에 추가

<jsp-config>

  <jsp-property-group>

    <url-pattern>*.jsp</url-pattern>

    <trim-directive-whitespaces>true</trim-directive-whitespaces>

  </jsp-property-group>

</jsp-config> 


2. @Page trimDirectiveWhitespaces 개별 true / false 설정