Thursday, November 24, 2011

Using Expression Language (EL) in JSP

To use EL in JSP, a page directive has to be specified:

<%@ page isELIgnored="false" %>


Then you can use EL in the JSP, e.g.:

<logic:iterate id="var" name="sampleForm" property="list" indexId="index"> 

          <p>${var.id}</p>
          <logic:equal name="var"
                       property="foo"
                       value="${sampleForm.list[index+1].foo}">
             Value is same as next entry.
          </logic:equal>
</logic:iterate>

No comments:

Post a Comment

CSP on Apache

To add CSP to root if sort of funny. The following will NOT work for most cases !!     <LocationMatch "^/$">        Header s...