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

Get Head First Servlets and JSP, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.