• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Tag Handler Class

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that it is a good idea to put servlet class in a package. But for practice, I tried creating a simple example without putting it in a package and it didn't work. I am using Tomcat.
Are tag handlers required to be in packages?
 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For servlet it should not be a problem. My simple servlet are working without package. But for tag handlers I think required to be in packages. BK

Originally posted by Allan Moster:
I know that it is a good idea to put servlet class in a package. But for practice, I tried creating a simple example without putting it in a package and it didn't work. I am using Tomcat.
Are tag handlers required to be in packages?


 
Allan Moster
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is it required to be in a package? Any explanation?
 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically because "no package" means the default package, and when Tomcat compiles the JSP that calls your taglib, it compiles it into its default package. See this thread for further info: http://www.javaranch.com/ubb/Forum18/HTML/000184.html
Note that different servers may implement things differently. This is not behaviour that is covered by the JSP spec.


[This message has been edited by Tim Duncan (edited October 24, 2001).]
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am so glad you asked this question!!!
I am using BEA Weblogic and my taglib was not working either. I spent most of this morning trying to get it to work, and eventually pushed it aside.
After seeing this, I put it in a package and voila: it worked.
So apparently both tomcat and WebLogic have issues if a taglib is not in a package. My servlets in the same web app. are not packaged and they work fine.
 
Allan Moster
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too bad it's not detailed in the specs!
 
She still doesn't approve of my superhero lifestyle. Or this shameless plug:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic