I've come across that issue before while using Weblogic.
Tomcat handles the expression correctly, whether you use single or double quotes for the expression.
What server is being used?
With regards to passing the value in directly, there are ways you could do it, but I doubt they are worth the effort.
- Modify your tag to use EL rather than scriptlet expressions. Basically you would make that attribute a String, and pass it to the JSTL Expression Evaluator.
- Make the attribute the "name" of the counter, and put the pageContext.getAttribute() call inside the custom tag - that cleans up your JSP a little.
But the way you have it right now will work fine.
Hope this helps,
evnafets