• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use custom tag?

 
ashley Jug
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have never user custom tag before in jsp. Trying to learn how to use it by displaying a date on a jsp page:

However when i am creating the handler class in eclipse :



I get a compilation error for this method:



I get the following compilation error message "Syntax error on token "return ", delete this token'. I cannot delete it since its not a void method.
The jar that i am using is jsp-api.

Any suggestion please?

Thanks



 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cut-n-pasted your code and it compiles fine. Are you sure you are showing us the real code that causes a problem?

Also, why are using the old JSP 1 "classic" tag support classes? You should be extending the modern SimpleTagSupport class.
 
ashley Jug
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

thanks for your reply i have just done a clean project on eclipse now it working.

However when i extend my class to SimpleTagSupport it gives me compilation error on the following code:




Any suggestion please?

Thanks a lot for your quick response.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SimpleTagSupport is a completely new and different system. You'll need to read up on how to use it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic