tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <mart...@apache.org>
Subject Re: Variables for attributes in own tags
Date Tue, 06 Jan 2004 05:06:06 GMT
On Mon, 5 Jan 2004, Matthias Winkler wrote:

> Hello,
>
> I have some tags that create X+V form elements (mixed
> XHTML and VXML). To name my form elements I want to
> use names passed by an application. They are available
> inside a bean. (struts application - values passed by
> action form)
> Along with the name more information is passed on to
> the user. When the form is filled out the values of
> the fields have to be sent back with the same bean.
>
> If I use <% out.write() %> to write down my tag and
> add the information from the bean, my tag will not be
> evaluatet.
>
> JSTL uses the ${} syntax to access information from a
> bean and use it inside a jsp page.
> I would like to do something similar but I do not
> know, how to access the information from the bean when
> I evaluate my tag.
>
> At the end I would like to be able to do something
> like:  <xv:input id=${mybean.name} ... />.
>
> Where can I find information on how jstl handels this
> problem?

This isn't hard to do, assuming you're OK with using the Jakarta Taglibs
implementation of JSTL. For an example, you might want to take a look at
the implementation of the Struts-EL tag libraries. These are just like the
regular Struts tags except that they allow you to use JSTL expressions in
the attribute values.

You can get the Struts-EL code by downloading the Struts source distro,
and looking under contrib/struts-el.

Hope this helps.

--
Martin Cooper


> Maybe there is another, easier solution to this
> problem?
>
> Best regards.
>
> Matthias Winkler
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> http://hotjobs.sweepstakes.yahoo.com/signingbonus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>

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


Mime
View raw message