Have you looked at the format library for these kinds of situations? Example:
<c:set var="messageDate"> <fmt:formatDate value="${aMessageInstance.message.createDate}" pattern="MMM dd yyyy hh:mma"/> </c:set> -----Original Message----- From: Eric Schneider [mailto:[EMAIL PROTECTED] Sent: Monday, June 28, 2004 5:34 PM To: Struts Users Mailing List Subject: Re: Converting Java Code in JSP to JSTL Can you use the JSTL tags to call static API? Something like this: <c:out value="StringUtils.abbreviate(${aTopic.subject}, 30)"/> Is this possible? Thanks, Eric On Jun 26, 2004, at 5:48 AM, Pedro Salgado wrote: > On 04/06/26 1:33, "Michael McGrady" <[EMAIL PROTECTED]> wrote: > >> Looks like a test, Caroline! >> >> At 05:20 PM 6/25/2004, Caroline Jen wrote: >>> I was told that JSTL can convert most of the Java code >>> in JSP. 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' value='0'/> >>> 2. i++; > <c:set var='I' value='${i + 1}'/> >>> 3. String prevArticle = null; > <c:set var='prevArticle'/> >>> 4. if ( numberOfPosts - 1 == 1 ) {} > <c:if test='${numberOfPosts} - 1 == 1'> >>> 5. if ( nextTopic != 0 ) > <c:if test='${nextTopic != 0}'> >>> 6. String threadID = String.valueOf( threadID_int ); > <c:set var='threadID' value='${threadID_int}'/> >>> 7. if ( threadRows.size() == 0 ) {} > <c:if test='${not empty threadRows}'> >>> 8. if ( previousOffset >= 0 || nextOffset >= 0 ) {} > <c:if test='${previousOffset} >= 0 || ${nextOffset} >= 0'> >>> 9. if ( prevArticle != null ) && ( !article.equals( >>> prevArticle ) ) {} > <c:if test='${not null ${prevArticle}} && ${article != prevArticle}'> > The article != preArticle I am not quite sure. > > Pedro Salgado > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]