This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes custom Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "custom "advice" tag example " Watch "custom "advice" tag example " New topic
Author

custom "advice" tag example

nisha chidella
Ranch Hand

Joined: Jul 24, 2008
Posts: 57
I tried the custom "advice" tag example from chapter 9 of HFSJ(pg.467). But am getting exception as : unable to compile class for jsp. AdvisorTagHandler cannot be resolved to a type.

I have 3 files here
1. myLib.tld




2. TestCustomTag.jsp


3.AdvisorTagHandler.java(AdvisorTagHandler.class is in the classes directory)



the java file compiles. all the files are at right places. what am i doing wrong ?


SCJP 5.0(100%)
Preparing for SCWCD
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

If I were you, I'd put the AdvisorTagHandler in a package. Leaving class files in the default package does not guarantee a correct behaviour.


[My Blog]
All roads lead to JavaRanch
nisha chidella
Ranch Hand

Joined: Jul 24, 2008
Posts: 57

If I were you, I'd put the AdvisorTagHandler in a package.


now it works. i was lazy to put a one line package statement. . But good i left that , else i wouldn't have known what you told:


Leaving class files in the default package does not guarantee a correct behaviour.


thanks Christophe.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: custom "advice" tag example
 
Similar Threads
attribute problem in custom tag
Question on Empty body content of Simple Tag Handlers
Problem in Adding Attributes to TLD file
AdvisorTagHandler unable to compile
org.apache.jasper.JasperException: Unable to compile class for JSP: