struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wes Wannemacher <w...@wantii.com>
Subject Re: custom tags and struts
Date Sat, 27 Sep 2008 14:58:38 GMT
I could be wrong, but I don't think EL can access static fields or
methods. The easiest thing would be to add a getter to a variable (maybe
your homeModel variable) that accesses this static field, then reference
it in your EL expression.

-Wes

On Sat, 2008-09-27 at 16:46 +0200, Gianluca Musella wrote:
> thank you Martin.
> 
> Last question on this topic.
> 
> I need to pass to my custom tag an attribute of boolean type.
> The problem is that my expr involves enum. The OGNL expr for this is:
> 
> homeModel.chapterFilter == @org.almayer.web.model.ChapterFilter@ALL
> 
> So I need something like:
> 
> <almayer:menu-item selected="${homeModel.chapterFilter ==
> @org.almayer.web.model.ChapterFilter@ALL}"/>
> 
> but it causes this error:
> 
> java.el.ELException: Error parsing ${...}
> 
> If I delete the @ chars the error disappear, but expression isn't
> evaluated correctly.
> Can someone helps me on this also?
> 
> Thanks
> 
> Gianluca
> 
> 
> 2008/9/27 Martin Gainty <mgainty@hotmail.com>:
> >
> > GianLuca
> >
> > that attribute is in the tld
> >    <attribute>
> >      <name>id</name>
> >      <required>true</required>
> >      <rtexprvalue>true</rtexprvalue>
> >    </attribute>
> >
> > cannot use rtexprvalue for tiles tags or for specifying the id
> > http://issues.apache.org/struts/browse/STR-2527
> >
> > Martin
> > ______________________________________________
> > Disclaimer and confidentiality note
> > Everything in this e-mail and any attachments relates to the official business of
Sender. This transmission is of a confidential nature and Sender does not endorse distribution
to any party other than intended recipient. Sender does not necessarily endorse content contained
within this transmission.
> >
> >
> >> Date: Sat, 27 Sep 2008 15:41:46 +0200
> >> From: gianluca.musella@gmail.com
> >> To: user@struts.apache.org
> >> Subject: Re: custom tags and struts
> >>
> >> > You can change the tag's rtexprvalue attribute to "true" to allow EL
> >> > expressions in S2 tags.
> >>
> >> How to do this?
> >>
> >> Thanks
> >>
> >> Gianluca
> >>
> >> 2008/9/27 Gabriel Belingueres <belingueres@gmail.com>:
> >> > You can change the tag's rtexprvalue attribute to "true" to allow EL
> >> > expressions in S2 tags.
> >> >
> >> > Or you can replace <s:property value="${property}"/> with <s:property
> >> > value="#attr.property"/>
> >> >
> >> > 2008/9/27 Gianluca Musella <gianluca.musella@gmail.com>:
> >> >> Thank you Dave, it's works using
> >> >>
> >> >> <almayer:dummy message="${currentPage.key}"/>
> >> >>
> >> >> But if I change my tag' s definition in this way:
> >> >>
> >> >> <%@ taglib prefix="s" uri="/struts-tags" %>
> >> >> <%@attribute name="property"%>
> >> >> <h2><s:property value="${property}"/></h2>
> >> >>
> >> >> incapsulating the use of the struts taglib into the tag, intending
to
> >> >> pass the property value as arguments, in this way:
> >> >>
> >> >> <almayer:dummy message="currentPage.key"/>
> >> >>
> >> >> I receive the error:
> >> >>
> >> >> According to TLD or attribute directive in tag file, attribute value
> >> >> does not accepr any expression
> >> >>
> >> >> I remember that this is for security purpouse, but daoe exist a
> >> >> workaround to hide the use of struts' taglib in the tag?
> >> >>
> >> >> Thanks
> >> >>
> >> >> Gianluca
> >> >>
> >> >>
> >> >> 2008/9/27 Dave Newton <newton.dave@yahoo.com>:
> >> >>> --- On Sat, 9/27/08, Gianluca Musella wrote:
> >> >>>> Buf I if use it in this way:
> >> >>>>
> >> >>>> <almayer:dummy message="<s:property value='currentPage.key'/>"/>
> >> >>>
> >> >>> You can't nest tags like that; that would imply double-evaluation
of the page.
> >> >>>
> >> >>> <almayer:dummy message="$currentPage.key"/>
> >> >>>
> >> >>> Dave
> >> >>>
> >> >>>
> >> >>> ---------------------------------------------------------------------
> >> >>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >>> For additional commands, e-mail: user-help@struts.apache.org
> >> >>>
> >> >>>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >> For additional commands, e-mail: user-help@struts.apache.org
> >> >>
> >> >>
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> > For additional commands, e-mail: user-help@struts.apache.org
> >> >
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >
> > _________________________________________________________________
> > Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
> > http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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


Mime
View raw message