开发者

Can generic types be used as the "type" of a composite component's attribute tag?

开发者 https://www.devze.com 2023-01-23 08:02 出处:网络
It looks to me like composite components\' attributes don\'t allow generic types. Here\'s a simple test case:

It looks to me like composite components' attributes don't allow generic types. Here's a simple test case:

<cc:attribute name="stringList" type="java.util.List&lt;java.lang.String&gt;" />

The error I get is,

java.lang.ClassNotFoundException: java.util.List<java.lang.String>

(If I replace the &lt; and &gt; with < and >, I get a error because that's not valid XHTML.)

I know that the gen开发者_开发百科eric part of the type will be erased at runtime, but I was hoping to use generics here just for clarity of reading the code. Is that possible?


no man its not possible

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号