• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple and Custom Tags problem

 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

While giving the mock exam on page no.549, I have come across the question 17 in which I have some doubt.

I feel the option D should also be in the list of answers.

D. <my:simpleTag>
<my:complexTag>
<% i++; %>
</my:complexTag>
</my:simpleTag>

The question was corrected in 'Errata' by saying both tags are non-empty and non tag-dependent. If complex tag uses 'JSP' for <body-content>, then I think D would also be the right answer. Am I missing something here?

Cheers,
Naren
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No! A SimpleTag can have a ClassicTag in its body provided the ClassicTag has no scriptlets

So even if ClassicTag's <body-content> is mentioned as 'JSP', this code would be invalid because SimpleTag's body indirectly has those invalid scriptlets.
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Vishwanath.

Is this your understanding or are you referring to any book or material? If so, can you point me, please?

Cheers,
Naren
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The answer explanation in the book, for option A) in this same question says,

A simple tag may include a complex tag in the body as long as that tag contains no scripting code


btw, I'm using 2nd ed. HFSJ
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again.

I'm using first edition and that's the reason there is no mention of this. I wonder how many these kind of points have been missed

Cheers,
Naren
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I find the rancher's notes to be very helpful... Its so easy to miss points while reading, even when they are mentioned. But we won't miss them from the notes...
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishwanath, is there any extra material covering the differences of first edition and second edition? If you have any copy. can you please pass on to me? I have my exam day after tomorrow.

Cheers,
Naren
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh! All the best for the exam!

I saw a thread by Bryan Basham saying there's nothing added in SCWCD 1.5 and the title was a mere marketing decision...
So you really need not worry. Dynamic Attributes is the only thing that got missed out in the first ed book.

 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks alot.

I also think following things are also covered...
<cut>, <jsp:fragment>, <%@ attribute ...%>, etc.

Have you seen these in the second edition?

Cheers,
Naren
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Naren,

Yes. <c: out> is covered. With a stress on escapeXml attribute.
What you need to know is-
escapeXml="true" instructs the engine to escape-markups wherever encountered, i.e not to consider them as some styling or rendering instructions but to treat them as plain text.
So would result in
<bold></bold> tags are cool
whereas
would result in
Bold Text
and remb: escapeXml="true" by default.



<jsp:fragment> is not covered... so no need to bother

<%@ attribute> directive yea... but its simple too - Just a way to specify the nature of the attribute (as you may not write a TLD, for a Tag File)
and remb: that directive applies only to Tag-Files.
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vishwanath,
You are very kind to explain all these. However, when I typed <%@ attribute, I meant <%@ variable as <%@attribute is already covered in the first edition. Though you said that the difference between first and second editions is about DynamicAttributes & <cut>, if possible can you think of any others roughly?
Without taking a chance, I'm also going through some bits in specs.

Cheers,
Naren
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no... <%@variable directive is not covered

Just go through the objectives and see check if you have covered it all...
Velmurugan's notes is great... It's pretty exhaustive and well, the objectives are listed in the notes itself Can save you a little googling through the docs
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a million mate.

Cheers,
Naren
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic