On Fri, 10 May 2002, Soefara Redzuan wrote:
> Thank you for explaining, Shawn. I'm starting to see why people say
> that JSP gets unwieldy for complex jobs.
The key is to use a consistent methodology; the language is at its worst
when page combine scriptlets and tags. Using even scriptlets alone is
cleaner than the combination, but it's better, of course, to migrate to
pages with just tags.
Using JSTL alone, you'd get code like this:
<sql:query sql="SELECT ..." var="result"/>
<select>
<c:forEach items="${result.rows}" var="row">
<option
<c:if test="${x == row.X}">selected</c:if>
>
foo
</option>
</c:forEach>
</select>
which is substantially cleaner and easier to debug than scriptlets.
--
Shawn Bayern
"JSP Standard Tag Library" http://www.jstlbook.com
(coming this summer from Manning Publications)
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>