O'Reilly logo

Head First Servlets and JSP, 2nd Edition by Bert Bates, Bryan Basham, Kathy Sierra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

We could just add more custom tag attributes...

image with no caption

Gary’s design is very simple; we just need to add a setter method for all of the HTML pass-through tag attributes The UML for the tag class is on the right, with all the methods we’ll need to add.

Here’s the code to make this work:

SelectTagHandler

+setOptionsList(List)

+setId(String)

+setClass(String)

+setStyle(String)

+setTitle(String)

+setLang(String)

+setDir(String)

+setOnclick(String)

+setOndblclick(String)

+setOnmouseup(String)

+setOnmousedown(String)

+setOnmouseover(String)

+setOnmousemove(String)

+setOnmouseout(String)

+setOnkeypress(String)

+setOnkeydown(String)

+setOnkeyup(String)

+setName(String)

+setSize(String)

+setMultiple(String)

+setDisabled(String)

+setTabindex(String)

+setOnfocus(String)

+setOnblur(String)

+setOnchange(String)

+doTag()

image with no caption

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required