JasperException, calling tag with dynamic data
Hello
I want to call a tag which I have written with dynamic data.
I can call the tag like this, and it works fine
<cm:getCalendar year ="2" week ="51" />
But I don't want the input to be hard coded.
Therefor I have tried to insert GET data to the tag like this
<cm:getCalendar year ="<%= request.getParameter("year")%>
" week = "<%= request.getParameter("week")%>" />
Or like this
<cm:getCalendar year ="%{#request.yearNr}" week ="%{#request.weekNr}" />
The%{#request.yearNr} should be struts 2 specific I think.
In both this cases I get this exception
org.apache.jasper.JasperException: /calendar.jsp(25,0) According to TLD or
attribute directive in tag file, attribute week does not accept any expressions
Is there a way which I could insert data dynamic to my own tag?
Here is the TLD file
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name></short-name>
<tag>
<name>getCalendar</name>
<tag-class>taglib.PrintCalendar</tag-class>
<body-content>JSP</body-content>
<attribute>
<name>year</name>
<required>true/false</required>
</attribute>
<attribute>
<name>week</name>
<required>true/false</required>
</attribute>
</tag>
</taglib>

