aspose file tools*
The moose likes JSP and the fly likes How to use custom tag? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to use custom tag?" Watch "How to use custom tag?" New topic
Author

How to use custom tag?

ashley Jug
Ranch Hand

Joined: Sep 02, 2011
Posts: 60
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

Joined: Jan 10, 2002
Posts: 61420
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ashley Jug
Ranch Hand

Joined: Sep 02, 2011
Posts: 60
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

Joined: Jan 10, 2002
Posts: 61420
    
  67

SimpleTagSupport is a completely new and different system. You'll need to read up on how to use it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use custom tag?