Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 4.0.1- translation Errors?

 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying out the Custom Tags examples from the "more Servlets and JSP" book. I modified the JSP so that the taglib declaration is after its use. I was expecting an (translation) error as mentioned in the 1.2 Specs. But I don't see any errors/exceptions.
Do I have a settings problem or am I missing something?
Thanks.
- satya
ps:
The relavent files are:
ExampleTag.java
msajsp-taglib.tld
and
SimpleExample.jsp
PPS: I am not sure if there are any copyright requirements. Pl. check with the publishers/author.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OOPS! Sorry just realised this example is following the JSP.1.1 Spec and not the 1.2 Spec.
Checkout the TLD file. I will change this and see what I get.
Do you know if I should get an (translation) error even according to 1.1 Spec.
I don't want to read another Spec now, but just curious....anyways, sorry!!!
- satya
 
R K Singh
Ranch Hand
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Madahv
Plz correct me if I am wrong
But I think Directives (i.e. page, taglib, include) are taken care while translating JSP in to servlets.
I checked the java files once after putting <@taglib > before use .. and once after custom tag use.
When you define <@taglib > after custom tags use then those coutom tags are treated as normal html tags i.e. any other text which is suppose to send to browser and not executed the way they are suppose to be executed.
But when you use it before the use of custom tags then everytime JSPEngine(translator) find custom tag it creats new object of your class which implemenets one of Interfaces defined in javax.servlet.jsp.tagext
SO when you define <@taglib > after use custom tags .. there will no error and they will send to client(browser) as any other tag. and browser will ignore them if it can not resolve them to any meaningful thing.
CMIW
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic