This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EL function TLD file: function-signature fully qualified name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL function TLD file: function-signature fully qualified name" Watch "EL function TLD file: function-signature fully qualified name" New topic
Author

EL function TLD file: function-signature fully qualified name

Luis Centeno
Ranch Hand

Joined: Jul 31, 2009
Posts: 46
I read in HFSJ that types (other than primitives) referred in <function-signature> element in TLD files for EL functions must be written in a fully-qualified way...However, I created below TLD file and surprisingly it works...



I thought it would have thrown a translation error but it worked fine and returned String value. Is String the default value when a type referred in <function-signature> cannot be found?


SCJP 6 | SCWCD 5
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

The book illustrates what is written in the JSP specification :
spec wrote:Type is a basic type or a fully qualified Java class name (including package name), as per the ’Type’ production in the Java Language Specification, Second Edition, Chapter 18.


Containers are known to be forgiving. They may allow things which are not 100% spec friendly. For the exam, trust your book better than your container.


[My Blog]
All roads lead to JavaRanch
Luis Centeno
Ranch Hand

Joined: Jul 31, 2009
Posts: 46

For the exam, trust your book better than your container.

Sure, I will...thanks a lot!
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Could you please give the answer in straight, because, we couldn't understand these complex sentences in English! Thanks for caring.

And what does mean by Basic Types? java.lang package classes? Thanks.


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

The return type (or parameter type) in the TLD should be fully qualified name of the class. So for SCWCD, you can say that the TLD is wrong as it uses String instead of java.lang.String. It might work on some containers, but the Specs say it should not work and the exam is based on the specs and not any containers...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Ankit Garg wrote:The return type (or parameter type) in the TLD should be fully qualified name of the class. So for SCWCD, you can say that the TLD is wrong as it uses String instead of java.lang.String. It might work on some containers, but the Specs say it should not work and the exam is based on the specs and not any containers...


Thank Ankit, now I got it. It's up to the Container developer. They can make these container to aware of these kind stuff or leave it (That means, the users of the container need to give full qualified names) Thanks!
 
jQuery in Action, 2nd edition
 
subject: EL function TLD file: function-signature fully qualified name
 
Similar Threads
calling a bean function using jstl
Custom tags in jsp - .tld file doubt
about EL Function
EL Function undefined Error
Do we have write seperate .tld files for each EL?