aspose file tools*
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
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: 16012
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
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
 
 
subject: Problems when package statement is missing