I'm writing a web application using JSP, and I really like to use the "XML style" JSP directive (i.e. <jsp:scriptlet> instead of <% ). But if I use generics in my code, the code content is not valid XML and I get compilation errors when the server (I use Jetty 6) tries to parse the file as XML.
For example, I want to write:
<jsp:scriptlet>
List<String> myText = new List<String>();
</jsp:scriptlet>
However this code obviously fails to compile. I tried adding CDATA wrapper around the code (immediately inside the jsp:scriptlet tag) but it doesn't look to make any difference.
Is it at all possible to use generics inside JSP scriptlets?
Thanks.