• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding Tags & tld

 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ranchers!Got a bit of problem in return type of tag methods.It states in the JSP1.2 Spec (pg 164 Tag Extension API) that
" If the TagLibraryDescriptor file indicates that the action must always have an
empty action, by an <body-content> entry of “empty”, then the doStartTag()
method must return SKIP_BODY. Otherwise, the doStartTag() method may
return SKIP_BODY or EVAL_BODY_INCLUDE. "
But if I try it out ie an empty tag & make the doStartTag() return EVAL_BODY_INCLUDE,then the code gives me no problem.
Also ,those of you who have the Manning book,their IfTag.java in chapter16 has following code :
if (condition)
return EVAL_BODY_INCLUDE;
else
return SKIP_BODY;
& the tld file has the <body-content> for that tag as empty.
Why is this so?
Also,if i put some junk values for the <body-content>(or for anthing in the tld)
ie <body-content>12345</body-content>
then it gives me no error & accepts the default value "jsp".
Any answers?
 
Vedhas Pitkar
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whaaaaaaat? No answers?
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't rely too much on the behaviour of Tomcat, the exam is not testing your knowledge of Tomcat.
Check Chawla's mock: default body-content
Some Web containers are very tolerant.
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vedhas, you're exactly right in that Tomcat is fairly lenient in this respect. I've been playing with Tomcat 5 recently and it's still the same.
Simon
 
reply
    Bookmark Topic Watch Topic
  • New Topic