This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes what are mandatory elements in TLD? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "what are mandatory elements in TLD?" Watch "what are mandatory elements in TLD?" New topic
Author

what are mandatory elements in TLD?

Will Lee
Ranch Hand

Joined: Mar 16, 2005
Posts: 58
Which of following are mandatory in TLD file?
a) tlib-version
b) jsp-version
c) short-name
d) tag
e) uri


I'm confused by answers from different source.
I remember HFSJ said a,c,e is required, but I did see many TLDs (maybe even HFSJ if I am right) don't include short-name;
Some other authors said they all are mandatory!! I can't agree with this, jsp-version is mandatory??

So what do you think?


SCJP 1.4, SCWCD, SCDJWS
Rizwan Mohammad
Ranch Hand

Joined: Sep 02, 2005
Posts: 445
According to tld from jsp spec tlib-version, jsp-version and short-name are mandatory.
Straight from jsp spec,
<!ELEMENT taglib (tlib-version, jsp-version, short-name, uri?, display-name?,
small-icon?, large-icon?, description?, validator?, listener*, tag+) >

from this i understand that tlib-version, jsp-version, short-name are mandatory. correct me, if i am wrong.


Rizwan
SCJA, SCJP, SCWCD, SCBCD, SCDJWS.
Will Lee
Ranch Hand

Joined: Mar 16, 2005
Posts: 58
I guess you are right. jsp-version become required in JSP1.2.
The funny thing is the spec of JSP1.1 & 1.2 both states short-name as mandatory in [!ELEMENT...], however it didn't mention this in the following description. At least I only saw "This element is mandatory/required" for tlib-version and jsp-version.
Rohan Kayan
Ranch Hand

Joined: Sep 17, 2004
Posts: 123
Ok , It means answer for that question will be A,B,C and D.


SCWCD 1.4, SCJP 1.4
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

Accoring to TLD XSD for JSP 2.0, only tlib-version and short-name is required.
tag and uri are defined optional and there is no jsp-version attribute in XSD for 2.0 as the taglib xml tag itself contain the version="2.0" mandatary attribute.

Thanks


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Will Lee
Ranch Hand

Joined: Mar 16, 2005
Posts: 58
Each version changes so much! What on earth is the answer?
In practice I wrote my own test TLD, w/out short-name, w/out jsp-version, it worked perfectly on tomcat5.5
It seems nothing is required!

What this exam tests? JSP1.2 or 2.0?
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

The SCWCD 1.4 exam test JSP 2.0


In practice I wrote my own test TLD, w/out short-name, w/out jsp-version, it worked perfectly on tomcat5.5


Have to used the tags definded in test tdl ? The XML elements like web.xml, tlds are not validated at the time of creating the .war files or at deplyment time. But there is server error , if something goes wrong at run-time or simply ignored the un-wanted stuff.

If you are using any IDE to write your application, there is XML validation. It validate your XML against DD or XSD.

Thanks
 
Have you checked out Aspose?
 
subject: what are mandatory elements in TLD?
 
It's not a secret anymore!