I want to get the affect of using one JSP tag within another. Unfortunately embedding tags within tags is not valid syntax. I have a taglib with one attribute like the following:
<custom:tag1 attrib="myAttribValue"/>
So what if I want to have attrib set by another JSP tag?
<custom:tag1 attrib="<custom:tag2 attrib2='myvalue'/>"/>
This did not work, of course. At this point I started trying all kinds of things. I tried many variations of this:
<%! String myresult = ""; %>
<% myresult = "%><custom:tag1 attrib='myvalue'/><%";%>
<custom:tag2 attrib="<%= myresult %>"/>
I can't figure this out. If I could access the tag as an object I could get it to work. Here is an example of a bean that works:
<custom:tag1 attrib1='<%= Message.getMessage("login.title" %>'/>
You can't use <bean:message key=""> here. You have to use the Message object, right.
Is there a way to access a taglib as an object? Do you know any way to get this to work?
<custom:tag1 attrib="myAttribValue"/>
So what if I want to have attrib set by another JSP tag?
<custom:tag1 attrib="<custom:tag2 attrib2='myvalue'/>"/>
This did not work, of course. At this point I started trying all kinds of things. I tried many variations of this:
<%! String myresult = ""; %>
<% myresult = "%><custom:tag1 attrib='myvalue'/><%";%>
<custom:tag2 attrib="<%= myresult %>"/>
I can't figure this out. If I could access the tag as an object I could get it to work. Here is an example of a bean that works:
<custom:tag1 attrib1='<%= Message.getMessage("login.title" %>'/>
You can't use <bean:message key=""> here. You have to use the Message object, right.
Is there a way to access a taglib as an object? Do you know any way to get this to work?