You need to specify the accelerated attribute type of the user tag. By default, it is java.lang.String , and the JSP container forcibly binds the attribute to the string before passing it to your tag. So it calls toString in your String array.
<%@ attribute name="items" required="true" type="java.lang.String[]" %>
or
<%@ attribute name="items" required="true" type="[Ljava.lang.String" %>
gotta do the trick. If not, using
<%@ attribute name="items" required="true" type="java.lang.Object" %>
should, but it's less clear.
source share