Re: Nested tag in attribute value
Kris Schneider <[email protected]>
| Newsgroups | gmane.comp.jakarta.taglibs.user |
|---|---|
| Message-ID | <[email protected]> |
As you've discovered, embedding one tag in the attribute value of another tag is "illegal" - even if you had gotten the quotes right ;-). You would need to do something like: <bean:define id="categoryId" name="category" property="id"/> <mt:clink url='<%= "/categoryEvent.do?event=edit&id=" + id %>'>Edit</mt:clink> I think. It's been awhile since I've been down that road... Quoting [email protected]: > Hi all, > > First of all, if this query has already been solved earlier, please > ignore below question and simply point me to the solution. > > In one of my projects am using Struts framework along with Hibernate. > While Struts provides many tag libs like bean, html and logic I still > felt need to create my own tags to avoid the code repetition and > generalize the coding style. In the course of creating custom tags, I > came across one issue as follows... > > How can I pass other tags runtime values to the attributes of my custom > tags like this.. > > <mt:clink url="/categoryEvent.do?event=edit&id=<bean:write > name="category" property="id"/>">Edit</mt:clink> > > In this case it gives me error : org.apache.jasper.JasperException: > /bo/category/categoryList.jsp(36,78) equal symbol expected > though I have already set the runtime expression value to true in tag > lib as follows.. > <attribute> > <name>url</name> > <required>true</required> > <rtexprvalue>true</rtexprvalue> > </attribute> > And getting this value in doStartTag method in tag handler class. > > Actually I am creating one custom tag that will automatically add > context path to the given url so that my app works on any context path. > I am using JSP version 1.1 in my taglib. > > Any help or suggestion to do this in better way? > > Thanks, > Lalit -- Kris Schneider <mailto:[email protected]> D.O.Tech <http://www.dotech.com/>