제목의 모든 것이 거의 같습니다. 이 호출의 결과에 대한 문서는 명확하지 않습니다.JspFragment.invoke는 정확히 무엇을합니까?
필자의 특별한 상황은이 메서드가 매개 변수로 전달 된 null로 호출되고 그 전후에 코드가 있다는 것입니다. 나는이 호출의 목적을 얻지 못한다 ...
컨텍스트는 SimpleTagSupport를 확장하는 클래스이다. (나는 taglib 일을하고있다.)
어떤 포인터 주셔서 감사합니다. 여기서, 자바 독은 :
가
public abstract void invoke(java.io.Writer out)
throws JspException,
java.io.IOException
Executes the fragment and directs all output to the given Writer, or the JspWriter returned by the getOut() method of the JspContext associated with the fragment if out is null.
Parameters:
out - The Writer to output the fragment to, or null if output should be sent to JspContext.getOut().
Throws:
JspException - Thrown if an error occured while invoking this fragment.
SkipPageException - Thrown if the page that (either directly or indirectly) invoked the tag handler that invoked this fragment is to cease evaluation. The container must throw this exception if a Classic Tag Handler returned Tag.SKIP_PAGE or if a Simple Tag Handler threw SkipPageException.
java.io.IOException - If there was an error writing to the stream.
본문이 전혀없는 태그 (태그 속성을 읽음으로써 html로만 변환 됨)에있는 경우이 호출은 아무런 효과가 없습니까? – Sephy
태그가 본문을 승인하지 않으면 javadoc을 올바르게 읽으면 조각이 null이됩니다. 본문이 있지만 문자가 포함되어 있지 않으면 효과가 없습니다. 공백이 있으면 공백이 작성자에게 기록됩니다. –
그래, 내가 아직도 내 코드에이 이유가 없더라도 조금 더 명확 해. 감사! – Sephy