struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Re[4]: EL Expression in html:hidden tag
Date Sun, 09 Nov 2003 04:54:07 GMT
Quoting Arne Brutschy <mai01cvr@studserv.uni-leipzig.de>:

> Hello,
> 
> Monday, November 3, 2003, 7:20:31 PM, you wrote:
> KS> I'm jumping in late on this thread, but why bother using Struts-EL at all
> under
> KS> JSP 2.0? The original (RT) tags should be magically EL-aware as long as
> the app
> KS> uses a Servlet 2.4 format web.xml, right?
> 
> Oh, really? I didn't know that. So I can work with the normal struts
> lib? I just need to declare a 2.4 web-app?
> 

And run in a Servlet 2.4 / JSP 2.0 container of course ;-)

Not only will EL expressions work for attributes in any tag (as long as the
attribute accepts runtime expressions), it will also work in template text. 
Consider a snippet like this to display a table of stuff from a list of
customer beans in a scoped variable named "customers":

  <table>
    <tr>
      <th>Account Id</th>
      <th>Customer Name</th>
      <th>Total Sales</th>
    </tr>
    <c:forEach var="customer" items="customers">
      <tr>
        <td>${customer.accountId}</td>
        <td>${customer.name}</td>
        <td>${customer.totalSales}</td>
      </tr>
    </c:forEach>
  </table>

JSP 2.0 has lots of other cool things to, including the ability to point at a
chunk of JSP code and treat it just like a tag, without having to write
anything in Java.

> Thanks,
> Arne
> 

Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message