I am trying to create a reusable module to display a table based off a list of objects passed to the JSP
Several of these lists are passed at a time, and each need to display their own table
The most sensible way I've found to do this would be through a custom tag, but it would be a few hundred lines of HTML that it needs to build, and I can't find a good way to do that
tag-file
doesn't seem to accept attributes to pass the list to the tag, and tag
programmatically through Java doesn't seem to have a way to give it a file to use as a template
Whoever worked on this code before me took the long way by building the entire HTML section line by line with a StringBuilder in the Java-side doTag()
method, and I'd rather avoid doing that if at all possible
Is there anything that I'm missing here as to how custom tags work?
The tag declaration is as follows:
<tag>
<name>dropdown</name>
<tag-class>{tag class location}</tag-class>
<body-content>empty</body-content>
<info>Displays dropdown information</info>
<attribute>
<name>drpList</name>
<required>true</required>
<description>list for dropdown</description>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>drpTitle</name>
<required>true</required>
<description>column titles</description>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>factLink</name>
<required>false</required>
<description>list of values</description>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
I am trying to create a reusable module to display a table based off a list of objects passed to the JSP
Several of these lists are passed at a time, and each need to display their own table
The most sensible way I've found to do this would be through a custom tag, but it would be a few hundred lines of HTML that it needs to build, and I can't find a good way to do that
tag-file
doesn't seem to accept attributes to pass the list to the tag, and tag
programmatically through Java doesn't seem to have a way to give it a file to use as a template
Whoever worked on this code before me took the long way by building the entire HTML section line by line with a StringBuilder in the Java-side doTag()
method, and I'd rather avoid doing that if at all possible
Is there anything that I'm missing here as to how custom tags work?
The tag declaration is as follows:
<tag>
<name>dropdown</name>
<tag-class>{tag class location}</tag-class>
<body-content>empty</body-content>
<info>Displays dropdown information</info>
<attribute>
<name>drpList</name>
<required>true</required>
<description>list for dropdown</description>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>drpTitle</name>
<required>true</required>
<description>column titles</description>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>factLink</name>
<required>false</required>
<description>list of values</description>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
Solved my own problem, and yes I was just missing something
I was looking at the configuration declarations of tag
and tag-file
, and didn't see that attributes in tag-file
are declared in the header of the file itself