Help coderanch get a
new server
by contributing to the fundraiser
  • 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

short-name tag in TLD

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am wondering whether the <short-name> element under the element <taglib> in JSP 2.0 is mandatory ?

Thanks for helping,
Adri

[ June 08, 2004: Message edited by: Adri Smith ]
[ June 08, 2004: Message edited by: Adri Smith ]
 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes it's mandatory. You can refer to page 3-16 of JSP 2.0 Specification where you can find short-name is defined as mandatory
 
Adri Smith
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for you answer buddy
You are right the spec says it is mandatory.

Here is the "but" I tested it on tomcat 5.0 and it accepts the TLD without this tag so is it Tomcat not fully compliant with the spec :roll:

I am not so confident about the spec JSP 2.0. It seems to have some errors.
For example the jsp-version element is not mentionned on the drawing at the page 400 and it is mandatory !
 
Sivasundaram Umapathy
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you are saying is true. Tomcat isn't 100% compatible to the specification. So it is always better to test in a different implementations. If you run the same code in resin, you get a error saying "short-name" is required. I personally use both tomcat and resin(which is very much compliant) to sort out these issues.

jsp-version was present in JSP 1.2's DTD. I don't see it in the schema definition of JSP 2.0. Now the version is an attribute of taglib element
 
Adri Smith
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is surprising is the behavior on Tomcat.

IT is not working if I do not put the tag <jsp-version>

and I tried with an attribute within the taglib element:

<taglib jsp-version="2.0">

It is raising an error
Error raised by Tomcat => "Mandatory TLD element missing or empty: jsp-version"

So what do you think ? is that Tomcat again not compliant or I make a mistake in the start tag of the element taglib.

Thanks,
Adri
 
Sivasundaram Umapathy
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post the contents of your tld file please?
 
Adri Smith
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure here it is:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<taglib>
<tlib-version>1.0</tlib-version>
<display-name>arithmethic functions</display-name>
<jsp-version>2.0</jsp-version>
<function>
<name>addition</name>
<function-class>functions.FunctionArith</function-class>
<function-signature>
java.lang.Integer add(int,int)
</function-signature>
</function>
</taglib>
 
Sivasundaram Umapathy
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you start your tld as

<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
version="2.0">
..rest of the tags ..

and try?
 
Adri Smith
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perfect it is working !

Thus we should put a version attribute and I used the syntax of the spec 2.3.

Thanks a lot,
this helping much,
Adri
 
They worship nothing. They say it's because nothing is worth fighting for. Like this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic