This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
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

Tag Handler Class

 
Allan Moster
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?
 
Bal Sharma
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?
 
Tim Duncan
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).]
 
mitchner green
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic