Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

question in tagdependent body-content

 
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.
 
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic