Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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.
 
straws are for suckers. tiny ads are for attractive people.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic