I was told that JSTL can convert most of the Java code in JSP.
Whoever told you that should be shot! It's not that JSTL is deficient, its just sort of like saying "I have heard that a honeydew melon can be used instead of a canteloupe." Theyr'e both round fruits, but they taste different.
JSTL relies on scoped variable where the scopes are pageScope, requestScope, sessionScope, and applicationScope. To get the variables into these scopes should be the job of your actions. You can create these scoped variables using other things such as jsp:useBean and bean:define. However, the best place is your action, (or other things like PlugIn, SessionListener, etc.).
I have not tested all of these so YMMV.
I still have some problem with initializing
variables and if statments; for example, I do not know how to write in JSTL of the following:
1. int i = 0;
<c:set var="i">0</c:set>
2. i++;
<c:set var="i" value="${i + 1}"/>
3. String prevArticle = null;
<c:set var="prevArticle" value=""/>
4. if ( numberOfPosts - 1 == 1 ) {}
<c:if test="${(numberOfPosts - 1) eq 1}"> </c:if>
5. if ( nextTopic != 0 )
<c:if test="${(nextTopic ne 0}"> </c:if>
6. String threadID = String.valueOf( threadID_int );
<c:set var="threadId" value="${threadID_int}"/>
7. if ( threadRows.size() == 0 ) {}
<c:if test="${empty threadRows}"> </c:if>
8. if ( previousOffset >= 0 || nextOffset >= 0 ) {}
<c:if test="${previousOffset ge 0 and nextOffset ge 0}"> </c:if>
9. if ( prevArticle != null ) && ( !article.equals( prevArticle ) ) {}
<c:if test="${(not empty prevArticle) and (article ne prevArticle)}"> </c:if>
Good Luck!
Bill Siggelkow
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]