Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

Re: How can one use OGNL on custom .tag files?

Dale Newfield

2010-03-12

Replies: Find Java Web Hosting

Author LoginPost Reply
wild_oscar wrote:
> However, EL security doesn't allow for expressions in the s:date tag.

This is true no matter where the tag resides (.jsp or .tag).

If you have an EL value you can use c:set to put it someplace (request
scope might be simplest) where you can also address it using ognl.

> <s:set var="aaa" >${dateField}.date</s:set>

Note this is setting the struts variable aaa to the string resulting
from evaluating "${dateField}.date", not the date object.

try something like this:
<c:set var="dateInTag" scope="request" value="${dateField}"/>
<s:date name="%{#request.dateInTag}"/>

and make sure that you've got taglib directives in the .tag file for all
the tag libraries you want to use.

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 gg3721.com - Jax Systems, LLC, U.S.A.