This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown


Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HF Page 766 Ques 12 Final Mock Exam


Given this tag handler

package com;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;

public class WorthLessTag extends TagSupport {

private String x;
public void setX(String x) { this.x = x; }
public int doStartTag() throws JspException {
try {
catch (IOException e) {}
return SKIP_BODY;


public int doEndTag() throws JspException {
try {
catch (IOException e) {}

return SKIP_PAGE;
return EVAL_PAGE;


and given this TLD

The tld clearly mentions that body-content should be empty but the doStartTag returns EVAL_BODY_INCLUDE.
Why doesn't this give an error ?
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... because it's allowed. Just like you can have tags that support JSP content, but tell your app that no JSPs can have JSP content without suddenly making everything not compile ... you can do the same thing here in your example. Basically, think of the tag as the object, and the TLD as the context for the tag -- two separate things.
She's out of the country right now, toppling an unauthorized dictatorship. Please leave a message with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic