gpt4 book ai didi

java - Jsp 中标签的数据类型

转载 作者:行者123 更新时间:2023-11-30 04:30:23 25 4
gpt4 key购买 nike

自定义标签

<%@attribute name="setValue" required="true"  rtexprvalue="true" %>
<%@attribute name="setColection" required="true" rtexprvalue="true" %>

我们可以用数据类型或集合来限制名称吗?即 setName 仅采用 intsetCollection 仅采用 Collection 即列表或 ArrayList

最佳答案

是的,你可以。使用类型属性:

<%@attribute name="setValue" required="true"  rtexprvalue="true" type="java.lang.Integer" %>
<%@attribute name="setColection" required="true" rtexprvalue="true" type="java.util.List" %>

我还将属性重命名为 valuecollectionitems

关于java - Jsp 中标签的数据类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14786865/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com