Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question in tagdependent body-content

 
Anoopriya Muthuswaami
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TagHandler:
public class TextTag extends TagSupport{

public int doStartTag() throws JspException {
return EVAL_BODY_INCLUDE;
}

}

TLD:
<tag>
<name>Text</name>
<tag-class>example.TextTag</tag-class>
<body-content>tagdependent</body-content>
</tag>

JSP:
EL <nw:Text> ${"hello"}</nw:Text> <br>
Scriplet <nw:Text> <%= "hello" %></nw:Text><br>
JSTL <nw:Text> <c ut value="hello"/> </nw:Text><br>
PlainText <nw:Text> Hello</nw:Text><br>

Output:
EL ${"hello"}
Scriplet
JSTL
PlainText Hello

as per my understanding, if body-content is tagdependent, everything(EL,scriptlet,std action, JSTL) are treated as plain text and the same will be printed to the response/browser.

My question is when EL gets printed, why not scripltet and JSTL action <c ut>

I expected the following output
EL ${"hello"}
Scriplet <%= "hello" %>
JSTL <c ut value="hello"/>
PlainText Hello

Please clarify me on this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic