File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

taglib encapsulate html elements - combobox - dropdown list

 
Seba Lenoir
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I would like to do a simple basic tag that can encapsulate the behavior
of a html combobox.
I though about something like a simple Java class that would have
2 fields: a list and a selecteditem.
When we give a reference to an instance of such a class in the jsp,
the taglib would render this html element.
<myTagLib:combobox name="myBean" property="myCombobox"/>

my first question is:
- Is there some basic class that my custom tag can extend to
handle usual attributes like 'name', 'property', 'id', ...
without having to re-develop theses funcionalities
- Is there some generic taglib open source that encapsulate all html elements
in a framework independently way?

All hints are welcomes

Seba
 
David Hibbs
Ranch Hand
Posts: 374
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My advice is to look into Struts and their html taglib. However, if you don't want to use it, the source is at least available so you can see how they did it.
Struts homepage:
http://jakarta.apache.org/struts/
Struts HTML Taglib:
http://jakarta.apache.org/struts/struts-html.html
Note that there's also a Frameworks forum here where people discuss frameworks such as Struts.
 
Seba Lenoir
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oki
The purpose to avoid diving into struts code.
But I think it's indeed a good alternative.
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out chapter 8 of my book, Professional JSP Tag Libraries (available to download from http://www.simongbrown.com) as this shows you how to build such a custom tag.
Simon
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic