On Thu, 27 Apr 2000, Rich Holladay wrote:

> By looking through the source code I've been able to figure out how to
> get the <form:select> tag to work.  It makes sense to me now.

Excellent.

> <form:select
>   name='<%-- the bean containing the currently selected value --%>'
>   property='<%-- the property of that bean which contains the value
> --%>'
>   list='<%-- some way to get the Collection -- %>'
>   value='<%-- the property of the List which contains the option value
> --%>'
>   text='<%-- the property of the List which contains the text that
> follows the <option> tag --%>'
> />

I may take this example and merge it in the documentation page, since
let's be real - I wrote my documentation page largely for ME. I find it
really useful, but I know what I'm about. :)

> I can see how this naming convention would make sense to a JSP
> programmer.  I wonder, though, if the target audience for custom tags is
> JSP programmers or HTML programmers?  If the target is HTML programmers
> then it might be more appropriate to change the parameter names
> slightly.

I thought about naming a lot when I created the tags (and, in fact, these
are the second-generation names.) More:

> <input type='select' name='MySelect'>  is what an HTML programmer is
> used to.
> Unfortunately, the JSP-centric tag requires the HTML programmer to use:
> <form:select property='MySelect' name='mybean'>
>
> This "incorrect" use of the name parameter is going to cause confusion.
> An alternative for parameter naming could be:
>
> <form:select bean='mybean' name='MySelect'>
>
> In that way the HTML programmer simply has to learn to add a new
> parameter to something very similar to the <input> tag they are used to.

The problem with this approach is that it matches HTML and not JSP - and
let's be real, this is still JSP. I chose naming conventions to match what
JSP already requires, through <jsp:getProperty /> and <jsp:setProperty />,
as much as I could; the list entry stuff comes from a very useful ejb tags
library. I used HTML conventions where I could, but mostly maintained
consistency with other tag libraries, on the assumption that a tool would
have to have two slightly different mechanisms for handling HTML
vs. JSP anyway, and a person hand-authoring it would have the same
requirement. It makes sense to match HTML as much as possible, but IMO I
thought going to the limit (while possible) wasn't wise because of prior
art (<jsp:getProperty name="myBeanName" property="myPropertyName" /> and
<form:text name="myBeanName" property="myPropertyName" /> are very
congruent.)

> By the way, if you get tired of getting email from me about this library
> feel free to tell me to cool it.
>
I'll tell you to cool it when I'm good and ready to do so - which will be
"never," guaranteed. Feedback is good. I need it to improve the taglib in
ways that everyone will find useful.

-----------------------------------------------------------
Joseph B. Ottinger               [EMAIL PROTECTED]
http://cupid.suninternet.com/~joeo      HOMES.COM Developer

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to