Advertisement

09.11.2007 at 07:41AM PDT, ID: 22820462
[x]
Attachment Details

Need help with JSTL if statement

Asked by huzefaq in Java Standard Tag Library (JSTL) & Server Tags, Java Server Pages (JSP)

Tags: jstl, statement

Hi Guys

I have this code where I check if the data is null before doing date formatting. In addition I also need to check if the length is greater than 0. Would yoou guys know how I can do that

<c:choose><c:when test="${fn:trim(current) != 'null'}">
                                          <c:set var="invoiceDate" value="${fn:trim(current)}" />
                                          <fmt:parseDate var="parsedInvoiceDate" value="${invoiceDate}" pattern="yyyy-MM-dd HH:mm:ss.SSS" />
                                          <fmt:formatDate value="${parsedInvoiceDate}" pattern="MM/dd/yyyy" />
                                          </c:when> <c:otherwise>
                                                      <c:out value="${current}" />
                                                </c:otherwise> </c:choose>

ThanksStart Free Trial
[+][-]09.11.2007 at 08:27AM PDT, ID: 19869486

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Standard Tag Library (JSTL) & Server Tags, Java Server Pages (JSP)
Tags: jstl, statement
Sign Up Now!
Solution Provided By: rrz@871311
Participating Experts: 3
Solution Grade: A
 
 
[+][-]09.11.2007 at 07:45PM PDT, ID: 19873561

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.13.2007 at 08:03AM PDT, ID: 19884290

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.22.2007 at 01:45PM PDT, ID: 20126722

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_1_20070628