"Craig R. McClanahan" wrote:
> 
> On Tue, 17 Jul 2001, Nino Walker wrote:
> 
> > Hi,
> >
> > I've noticed a number of postings asking about syntax using embedded
> > tags, a la: <tag attribute="<bean:write bean="..." property="..." />
> > .../>
> >
> > It's clear that this is not supported, but has anyone implemented a
> > different solution to address this?
> >
> 
> In case people aren't aware, it's a restriction in the JSP spec ... and,
> the ultimate reason is that it's invalid XML syntax as well.
> 
> > I'm coming form the world of ATG/JHTML, where they support syntax like:
> > <tag attribute="bean:BeanName.property"> and <tag
> > attribute="param:ParamName">
> >
> 
> The standard approach to this requirment in JSP is to use runtime
> expressions.  Where you might want to write
> 
>   <tag attribute="<bean:write name="foo" property="bar.baz"/>" />
> 
> you can write this instead:
> 
>   <jsp:useBean id="foo" class="..." scope="..."/>
>   <tag attribute="<%= foo.getBar().getBaz() %>" />
> 
> > This has been very convenient, and I'm curious if there are solutions
> > existing, or on the horizon, that solve this problem.

Yes. Have a look at JSPTL
(http://jakarta.apache.org/taglibs/doc/jsptl-doc/jsptl-ea1/index.html).

JSPTL allows you to do the following by using the Simplest
Possible Expression Language (SPEL) provided with the reference 
implementation:

  <tag attribute="$foo.bar.baz"/>
  <tag attribute="$param:paramName"/>

    -- Pierre


> >
> > Thanks,
> >
> > Nino
> >
> >
> 
> Craig

Reply via email to