Java variable across multiple include blocks - variable cannot be resolved

后端 未结 2 1494
隐瞒了意图╮
隐瞒了意图╮ 2020-12-28 16:04

I have jsp page that looks something like this:

MyPage.jsp

<%@ include file = \"/Title.jsp\" %>
<%@ include file = \"/Header.jsp\" %>
&         


        
2条回答
  •  情深已故
    2020-12-28 16:44

    To your question: Is there a way to tell Eclipse to ignore this particular error for this particular variable? As noted above, the error is coming from the validation framework in Eclipse. The best you can do is to tell eclipse to ignore that file - not that error or that variable. To do so, right click on the project and pull up it's properties dialog. Once there, select "Validation" and click the checkbox for "Enable project specific settings". From there you can turn on or off specific validations. Personally, I don't find the Eclipse validators all that useful and they take quite a bit of processing time, so I turn almost all of them off! However, you have some fine grain control via the "Settings" column. You hit the elipsis next to JSP Content Validator (for example) and you can specifically exclude only Header.jsp from there.

    Hope this helps, it only provides the details to the earlier comments though.

提交回复
热议问题