I have some attributes declared by something like <%@attribute name="listname" required="true"%>
in the starting in .tag
file.
I can print that by using ${listname}
. But I want to use this variable in one of the java code inside the same page.
Something like,
<%
String listname = ${listname};
...Some more code...
%>
How do I do this.
I am using apache tomcat6 if that helps.
I am new to this environment and even Java. Please forgive and correct me if I am using some wrong terminologies.
Have you looked into doing the processing in a Java class instead of a JSP? The configuration is a little bit different than using .tag files:
web.xml
mytaglib.tld
JSP Include
Tag Support Class
This is a decent example of how to implement things in your tag support class too:
http://www.tutorialspoint.com/jsp/jsp_custom_tags.htm