2011-08-01 3 views
1

나는 이와 비슷한 문제에 직면 해있다. Embedding a link (or other html) in a JSF message
h : 메시지에 앵커 태그를 삽입하고 싶다. 언급 된이 솔루션은 JSF 1.2에서 작동합니다. 하지만 내 프로젝트에 JSF 1.1이 붙어있다. ResponseWriterWrapper는 1.2에서는 사용할 수 없습니다. 이 주변의 어떤 방법?
@BalusC - 웹상의 모든 게시물에 감사드립니다. :)JSF 1.1 - h : 메시지에 HTML 포함하기

답변

0

바로 ResponseWriterWrapper 클래스를 만드십시오.

public abstract class ResponseWriterWrapper extends ResponseWriter { 

    public abstract ResponseWriter getWrapped(); 

    @Override 
    public String getContentType() { 
     return getWrapped().getContentType(); 
    } 

    @Override 
    public String getCharacterEncoding() { 
     return getWrapped().getCharacterEncoding(); 
    } 

    @Override 
    public void flush() throws IOException { 
     getWrapped().flush(); 
    } 

    @Override 
    public void startDocument() throws IOException { 
     getWrapped().startDocument(); 
    } 

    // Etc... Just override all abstract methods of ResponseWriter 
    // and delegate the call to getWrapped(). There are 15 of them. 
} 

기본적으로 편리한 클래스이므로 하나 또는 두 개의 메소드 만 필요할 때마다 15 개의 모든 추상 메소드를 구현할 필요가 없습니다.

+0

감사합니다. 이걸 시도하고 돌아올거야. –