gpt4 book ai didi

java - Eclipse 显示无效字符或无效文本字符串或标签未正确关闭

转载 作者:行者123 更新时间:2023-12-02 12:06:08 34 4
gpt4 key购买 nike

Eclipse Neon.3 Release (4.6.3) 在这行代码中报告错误:

<select id="<%=province.id%>" data-placeholder=" " <%=province.multiple%> class="chzn-select" style="margin: 1px auto;width:260px;">
</select>

报告的错误是:

Multiple annotations found at this line:
- Start tag (<select>) not closed properly, expected '>'.
- Invalid character used in text string (<%=province.multiple%> class="chzn-select" style="margin: 1px auto;width:260px;">).
- Invalid text string (<%=province.multiple%> class="chzn-select" style="margin: 1px auto;width:260px;">).

当我删除<%=province.multiple%>时从线上看,Eclipse 停止报告这些错误,但据我所知,这是有效的代码。这是什么问题?

最佳答案

应该这样吗

<select id="<%=province.id%>" data-placeholder=" " <%=province.multiple%> class="chzn-select" style="margin: 1px auto;width:260px;">

是(已更新)

<select id="<%=province.id%>" data-placeholder=" " multiple="<%=province.multiple%>" class="chzn-select" style="margin: 1px auto;width:260px;">

在这种情况下不一定相关,但也发现了这一点(参见详细信息 here ):

In XHTML, attribute minimization is forbidden, and the multiple attribute must be defined as input multiple="multiple"

那么文件后缀也可能使 Eclipse 变得更加关键:如果它是 .xhtml 内容可能必须是 .xhtml .

一个好 - 也许不直接相关 - 问题:What is the difference between creating JSF pages with .jsp or .xhtml or .jsf extension

关于java - Eclipse 显示无效字符或无效文本字符串或标签未正确关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46898481/

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