Eclipse IDE 中的意外 HTML/JSP 警告
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15197102/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unexpected HTML/JSP warnings in Eclipse IDE
提问by Roney Michael
I'm relatively new to HTML. I was initially working in a .html document which did not give me any warnings out of the ordinary in Eclipse. However, I changed it to a JSP, with a few added functionalities and now I seem to be getting certain warnings like
我对 HTML 比较陌生。我最初在一个 .html 文档中工作,它在 Eclipse 中没有给我任何异常的警告。但是,我将其更改为 JSP,并添加了一些功能,现在我似乎收到了某些警告,例如
Multiple annotations found at this line:
- Invalid location of tag (td).
- Undefined attribute name
(width).
for lines such as
对于诸如
<td width="300"><label for="select">Based on:</label>
<form:select path="basedOn">
<form:option value="Event_Name" label="Event Name"/>
<option value="Product_Name">Product Name</option>
</form:select>
</td>
even though it seems to be working fine when I try it in my browser.
即使当我在浏览器中尝试时它似乎工作正常。
I did see similar SO posts where they had suggested that this might be because my version of eclipse might be outdated, but that is not the issue here; eclipse is up to date.
我确实看到过类似的 SO 帖子,他们建议这可能是因为我的 eclipse 版本可能已经过时,但这不是这里的问题;eclipse 是最新的。
Is it a problem with how I coded the JSP or is this a known issue? In either case, can I suppress the warnings in any way?
是我编写 JSP 的方式有问题还是这是一个已知问题?在任何一种情况下,我都可以以任何方式抑制警告吗?
回答by PSR
- Right click on your project, Properties -> Validation (or you can go to Window -> Preferences -> Validation to do this globally).
- Uncheck "Build" for HTML syntax validation OR Click ellipsis under "Settings" and add a rule to exclude specific file name / extension / what have you.
- 右键单击您的项目,属性 -> 验证(或者您可以转到窗口 -> 首选项 -> 验证以全局执行此操作)。
- 取消选中“构建”以进行 HTML 语法验证或单击“设置”下的省略号并添加规则以排除特定文件名/扩展名/你有什么。
No problem with this warnings for you.
这个警告对你来说没有问题。