Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to load tag handler class "com.tutorialspoint.HelloTag" for tag "ex:Hello"  RSS feed

 
J Mohandos
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to create a custom tag, but I am getting the error message:

Unable to load tag handler class "com.tutorialspoint.HelloTag" for tag "ex:Hello"

I am following the steps given in the tutorial:

http://www.tutorialspoint.com/jsp/jsp_custom_tags.htm

/Users/s.m/Documents/com/tutorialspoint/HelloTag.java


/Users/s.m/Downloads/apache-tomcat-7.0.57/webapps/ROOT/main.jsp


/Users/s.m/Downloads/apache-tomcat-7.0.57/webapps/ROOT/WEB-INF/custom.tld


I am running under MAC system. What could be wrong?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66143
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you compiled the tag class and put the class file somewhere appropriate?

(And it's Mac, not "MAC" -- it's not an acronym.)
 
J Mohandos
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.

I am using another system which is running windows. I am getting the same error.

Where should I place the HelloTag.class file? My settings are as shown in the attached image.
sc2.png
[Thumbnail for sc2.png]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66143
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most customary place would be WEB-INF/classes/com/tutorialspoint

Is this something unfamiliar? If so, read the Tomcat docs on web app structure.
 
J Mohandos
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It worked. Thanks.

BTW can I not set the classpath as C:\Users\hp\Downloads and place the .class file there because the tutorial I am referring to(which is not the official documentation) says we can place the .class file in the classpath and it should work.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66143
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Web applications have nothing to do with the system classpath; they create their own using the rules set out by the Servlet spec.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!