简体   繁体   中英

How to get rid of a false error in IBM RAD 8 / Eclipse?

I use JSP include and from my IDE (IBM RAD 8) I get an error that it can't find variables and that imports can't get resolved but those variables and imports are actually handled in the file that includes the JSP my IDE is complaining about. So is there some setting or likewise that I can use to get rid of this false positive since it is not a compile error that a JSP that is included uses a variable from the page that includes it? 在此处输入图片说明 For includes we should be able to set what references the include if the IDE can't find it so that this false error won't appear. How is this setting possible?

Thanks for any help

If you use the default jspf extension for fragments, the IDE should be able to distinguish between pages and their dependencies. See RAD Infocenter .

When this is done, a validation error shows up in the include declaration if the container does not provide a dependency.


As an aside: consider dropping scriptlets in favour of the Expression Language; consider using JSP comments instead of HTML comments. See the JSP style guide for more.

I had the same problem. You can turn off validation in RAD. If possible, only the .jspf files should be unable to compile, and you can exclude those only. However, if you have uncompilable fragments in .jsp files, you will have to turn off validation for all .jsp files and lose the benefit of .jsp validation!

The process is here. (Although it says RAD 7, it also works for RAD 8.)

  1. First disable validation of .jspf files: http://www-01.ibm.com/support/docview.wss?uid=swg21284702

  2. If you need to disable validation of .jsp files, then go to Window -> Preferences (or right click on the project and select Preferences, to make this change for a project instead of the entire workspace) and go to the Validation option. Uncheck the two checkboxes for JSP Syntax Validator. I don't recommend doing this, because RAD will no longer help you find legitimate JSP syntax errors, but your project should validate and compile if there are no other errors.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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