본문 바로가기

Programming/SCWCD

문제1 풀이

  1. Under what two circumstances is the setJspBody method NOT called in a tag class that implements the SimpleTag interface?(Choose two.)

 

A. The tag is invoked without a body.

B. The doTag method throws an exception.

C. The <body-content> element has the value empty.

D. The tag is called with the attribute skip-body=true.

 

흠 아직 공부를 하지 안한 부분이네;;; 난감하당 1번부터;;;

안되겠다.... 좀 더 미루자 ㅜㅜ

다음 주 월요일에는 +_+ )/ 반드시 풀어 보리라~~~!!!!

<!-------------------------------------------------------------------------------------------------------------------->

 

위의 문제는 심플 태그에 관련된 내용으로 <body-content> empty </body-content>인 경우 setJspBody 메소드가 호출이 되지 않는다.

<body-content> 값의 내부에는 empty 말고도 3개의 타입이 더 있다.

  1. scriptless : 스크립팅은 올 수 없다는 말입니다.
  2. tagdependent : 태그 몸체를 그냥 텍스트로 취급한다는 말입니다.
  3. JSP : JSP 안에 들어 갈 수 있는 것이라면 무엇이든지 가능하다는 의미입니다.

위의 3가지 경우에는 setJspBody()가 호출된다.

 

setJspBody가 호출되지 않는 경우가 다음과 같이 있다.

<foo:bar/>

<foo:bar></foo:bar>

태그를 위와 같이 body가 없이 호출을 했다면 setJspBody는 호출되지 않는다.

<!-------------------------------------------------------------------------------------------------------------------->

 

이 글은 스프링노트에서 작성되었습니다.