본문 바로가기
프로그램/Java

[JSP] Weblogic 에서 <% 같은 JSP 태그와 CDATA 를 같이 사용하면 다음의 오류가 난다.

by 로드러너 2014. 2. 20.
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

톰캣에서 작업한 소스를 WebLogic 에 올리고 나서 이 오류 때문에 한참을 고생했다.

CDATA를 제거 했는데 같이 사용할 수 있는 방법이 없나?

 

A translation error occurred with taglib and CDATA in a JSP page, as shown in this snippet:

 

sample.jsp : <%@ page contentType="text/xml" %> <?xml version="1.0" encoding="iso-8859-1" ?> <%@ taglib uri="http://java.sun.com/jstl/core"; prefix="c"%>

 

<ablock> <![CDATA[ This is a cdata block ]]> </ablock>

 

When the JSP is compiled using the weblogic.jspc compiler, here is the output:

 

"sample.jsp": Translation of /sample.jsp failed: javax.servlet.jsp.JspException: The taglib validator rejected the page: "org.xml.sax.SAXParseException: The element type "jsp:text" must be terminated by the matching end-tag "</jsp:text>"., "

 

A code fix checks the existence of CDATA while converting the content in XML syntax to a  JSP document.