This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Problems when package statement is missing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problems when package statement is missing" Watch "Problems when package statement is missing" New topic
Author

Problems when package statement is missing

Suprakash Das
Greenhorn

Joined: Nov 26, 2000
Posts: 18
Hi all,
I am using Tomcat 4.0. I wrote a simple tag, without a package statement and placed the MyTag.class file in WEB-INF/classes. The Jsp page using the tag doesn't compile...Compile Exception No class found... MyTag.
When I change the tag to include a package statement it works without a hitch.
This has happened before with other servlet containers. I was wondering if anybody knew the reason for this behaviour of servlet containers.
Thanks in advance.
das
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17151
    
  27

You'd have to show us the taglibrary descriptor. That's what makes a tag accessible. Otherwise there's a potential security problem if I could take any class in the classpath and pretend it was a tag library. Though considering the infrastructure required it's a pretty minor one.


An IDE is no substitute for an Intelligent Developer.
Suprakash Das
Greenhorn

Joined: Nov 26, 2000
Posts: 18
This is the tld for the tag. I placed HelloTag.class under WEB-INF/classes in my webapp.
<tag>
<name>hello</name>
<tagclass>HelloTag</tagclass>
<info>
Print hello and name
</info>
<attribute>
<name>first</name>
<required>true</required>
</attribute>
<attribute>
<name>second</name>
</attribute>
</tag>
I want to know what the jsp engine does when it encounters a class without a package structure.
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems when package statement is missing
 
It's not a secret anymore!