简体   繁体   English

如何在Eclipse helios中禁用JSP验证?

[英]How to disable the JSP validation in Eclipse helios?

I have a Maven project set up in my Eclipse Helios 3.6 . 我在Eclipse Helios 3.6中设置了一个Maven项目。 It builds and deploys perfectly fine. 它构建和部署完美。 But it shows a red mark on my project and shows a lot of JSP issues. 但它在我的项目中显示了红色标记,并显示了许多JSP问题。 I want to somehow get rid of these JSP validation issues in problem view. 我想以某种方式摆脱问题视图中的这些JSP验证问题。 One example of JSP issue is ArrayList can not be resolved to a type. JSP问题的一个例子是ArrayList无法解析为一个类型。 What I have done for this is inside window->preferences->web->jsp files->validation I have unchecked the validate jsp fragments Apart from this I right clicked On my project. 我为此做的是在window-> preferences-> web-> jsp files-> validation我已经取消选中了validate jsp片段除此之外,我右键单击了我的项目。 Go to Properties->Validations then checked suspend all validator check box but stiil i see same issues in problem view and see red mark on my project? 转到属性 - >验证然后选中挂起所有验证器复选框, 但是我在问题视图中看到相同的问题,并在我的项目中看到红色标记?

I do similar as Aravind but I do it on the general settings: Preferences > Validation. 我和Aravind的做法类似,但我在常规设置上执行:首选项>验证。 Here I deselect all 'Build' checkboxes but leave the 'Manual' select for when I want to manually validate a JSP, XML, ... . 在这里,我取消选择所有“构建”复选框,但在我想手动验证JSP,XML,...时保留“手动”选项。

I'm using sts-2.5.0.RELEASE (based on Eclipse 3.6) and I solved the problem unchecking these properties: 我正在使用sts-2.5.0.RELEASE(基于Eclipse 3.6),我解决了取消选中这些属性的问题:

Preferences > Validation > JSP Content Validator (uncheck manual & build) 首选项>验证> JSP内容验证程序(取消选中手动和构建)

Preferences > Validation > JSP Syntax Validator (uncheck manual & build) 首选项>验证> JSP语法验证器(取消选中手动和构建)

@Stijn's answer works great, but it disables all validation for JSPs. @ Stijn的答案很有用,但它禁用了JSP的所有验证。 Sometimes, that validation can be very useful to point out where you've got errors. 有时,验证可能非常有用,可以指出您遇到错误的位置。

If you still want to have your normal JSPs validated, just not your JSPFs (JSP fragments), follow these steps: 如果您仍希望验证正常的JSP而不是JSPF (JSP片段),请执行以下步骤:

  1. Open Window > Preferences from the menu. 从菜单中打开Window > Preferences选项。
  2. Navigate to Web > JSP Files > Validation . 导航到Web > JSP Files > Validation
  3. Uncheck the "Validate JSP fragments" checkbox. 取消选中“验证JSP片段”复选框。

This is one of the first things I do with web projects that use JSPs in a new Eclipse installation. 这是我在新Eclipse安装中使用JSP的Web项目的第一件事。 I've just confirmed in the JEE version of Eclipse Mars, but I'm pretty sure it'll work pretty much the same way in older versions as well, going back to around 3.2. 我刚刚在Eclipse Mars的JEE版本中得到了证实,但我很确定它在旧版本中的工作方式也大致相同,可以追溯到3.2左右。 Your JSPs should still get validated, but the validator should leave your JSPFs alone... obviously, your fragments must use the .jspf extension for this to work. 您的JSP仍然应该得到验证,但验证器应该单独留下您的JSPF ...显然,您的片段必须使用.jspf扩展才能工作。

我通常执行以下操作 - 右键单击​​项目 - 属性 - 验证 - >在验证框架上配置设置链接 - 禁用所有。还要右键单击项目 - 属性 - 验证 - > JSP语法 - 取消选中项目特定设置。

右键单击JSP文件>属性选择“派生”复选框。

Instead of disabling your validations, which is a good aspect in eclipse. 而不是禁用您的验证,这是eclipse的一个很好的方面。

Just select the whole code cut and paste it back on the same page, All the reds will vanish automatically. 只需选择整个代码剪切并将其粘贴回同一页面,所有红色将自动消失。 If the reds are still present, that means there is some problem in the code which you are writing. 如果红色仍然存在,则表示您正在编写的代码中存在一些问题。

Validations generally help you alot in eclipse, the jsp's can sometimes be an issue regarding these validations. 验证通常可以帮助你进行日食,jsp有时会成为关于这些验证的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM