2015-01-29 5 views
1

ADF를 처음 사용합니다. 도와주세요. 내 코드 스 니펫 붙여 넣기 : - \ n을 사용하여 새 회선 메시지를 인쇄 할 수 없습니다.<af:message> n을 무시하고 한 줄에 인쇄합니다.

<af:message id="errMessage" message="#{backingBeanScope.ta_del_entUiBean.errorMessage}" messageType="error"   
            visible="#{backingBeanScope.ta_del_entUiBean.error}"/> 



public String getErrorMessage() 
    { 
     return message; 
    } 




message contains a String this way, say : The following error have occurred. \n 1. Null ponter exception. \n 2. ODBC Exception \n. 3. JDBC Exception 

The output is . 
The following error have occurred. 1. Null ponter exception. 2. ODBC Exception . 3. JDBC Exception 

How do I make it appear as 

The following error have occurred. 
1. Null ponter exception. 
2. ODBC Exception 
3. JDBC Exception 


Thanks a lot for the help. The Java Platform version is 1.7.0_51 and the `Jdev` version is 12.1.3.0 
+0

참조 http://stackoverflow.com/questions/27907839/new-line-character-in-jdeveloper-string-in-java/27915419#27915419 – amishra

답변

0

나는 동일한 문제가있었습니다. 그러나 우리 고객은 IE 브라우저를 사용하고있었습니다. 그것은 IE 브라우저에서 잘 작동합니다.

0

af : message 또는 af : messages 구성 요소의 문제점은 페이지에서 처음 렌더링 된 후 내용이 첨부된다는 것입니다. 그래서 "\ n"이나 "\ r"과 같은 특수 문자가 포함 된 텍스트를 삽입하면 그대로 출력됩니다 (실제로는 구문 분석 방법을 알고있는 컴파일러 만 알고 있지만 사용하고 있다는 것을 기억하십시오). ADF는 System.out.println()의 경우처럼 표준 출력이 아닌 구성 요소를 처리합니다.
이 점을 염두에두고 브라우저에서 콘텐츠를 인쇄하는 방법을 알려줘야합니다. 방법? 메시지 본문에 HTML 태그를 삽입하기 만하면됩니다. 귀하의 경우, 메시지 문자열이 있어야한다 :

<html><body> 
The following error have occurred.<br/> 
1. Null ponter exception.<br/> 
2. ODBC Exception<br/> 
3. JDBC Exception<br/> 
</body></html> 

또는 대신 단락 태그 내에서 줄을 묶어야 할 수 있습니다 (< 페이지>).