John,

I agree that the files are testing edge-cases.  I have noticed other issues with NetBeans JSP (and JSF) page parsers that have not been working.  When using Jakarta EE 9+ (using the jakarta, rather than the javax, packages) the code completion/suggestions (ctrl+space) do not show any of my own code; none of my CDI beans appear in the drop-down for auto-completing my JSP/JSF expressions.  Hopefully, Apache gets on this quickly and the next version of NetBeans remedies their JSP and JSF parsers.

I've never had good luck with escaping quotes within in-page expressions.  To me, edge cases represent exceptions and "sketchy" practices so I have always looked for another way to accomplish the task.  If I needed the ${ characters, or a double/quote, on the page as part of a code display then I'd be sure they were in the String object from the back-end that was being told to display using EL.  I tend to believe my pages exists merely to display data, and call actions, from the back end.  If there's any data manipulation that needs to be done then I perform it in my business logic so anything that needs to use the data uses the same rules, for ease of maintenance; the "Encapsulation" principle of Object-Oriented Programming.

Good luck to you with building Tomcat!

-- Jason Abreu

On 2/25/22 06:21, John wrote:

Hi Jason,

Thanks for your analysis and as you correctly point out, if I remove one or other of the formats.

However, the Tomcat team, on approaching them, indicated that it might be that NetBeans was ignoring the following directive as part of its parser.

<%@ page isELIgnored="true" %>

Which (when I google it), seems to imply that the JSP EL parsing should be ignored and so the contents taken literally – I.e. strip out the external ${...} leaving <%= "hello world" %> which would be parsed using JSP Expression language.

These examples are some of the standard Tomcat test files that they use to validate Tomcat and so I don’t think they will welcome it if I simply reverted it to JSP EL as I suspect that this has been written like this deliberately so that they can check that Tomcat handles the ‘isELIgnored’ flag when it is set to true.

Could I ask for one other contribution, if you don’t mind. There was one other file that didn’t pass the NetBeans validation. I have attached a screenshot. Adjusting the text, it appears that NetBeans doesn’t like the escaped double quotes

e.g.     <tags:echo echo="${\"2\"}az-07" />

If I replace them with single quotes (don’t need escaping) then NetBeans is happy. Again from the screenshot, you can see that the file has been designed to test the variations of specifying a string to make sure that Tomcat handles them all, so amending the source so that NetBeans doesn’t complain isn’t really an option.

I should make it clear that I am simply someone who, in an ideal world, is looking to generate a clean build / UI using NetBeans, my preferred IDE.

So, my deduction is that these two issues are boundary cases that have not been considered by the NetBeans JSP parser, albeit purist cases. If that is the case, I can raise a bug request so that they may be considered next time someone is reviewing the parser.

John

*From: *Jason Abreu <mailto:jace.ab...@gmail.com>
*Sent: *24 February 2022 19:50
*To: *users@netbeans.apache.org
*Subject: *Re: .jsp files showing exceptions

John,

Your syntax in the screenshot is incorrect.  Use the scriptlet tag

expression (the <%= ... %>) OR use the JSP Expression Language syntax

(the ${ ... }).  You don't use both.  The current accepted

standard/practice is to use the JSP EL instead of the scriptlet tag.

-- Jason Abreu

On 2/23/22 07:12, John Barrow wrote:

> Hi,

>

> Similar to the previous email (sent a few minutes ago), I am working

> with the Tomcat project and NetBeans is reporting exceptions on a few

> of the .jsp files. I have attached screen shots of one (very basic)

> .jsp file and I can't seem to resolve the exception. I suspect that it

> is some sort of configuration issue in NetBeans / project definition

> of Tomcat. Again, Tomcat is an Ant based project.

>

> I have googled around and found very old reported issues with Eclipse

> lying about exceptions, but not about NetBeans and so wondering if

> this is something I should just ignore.

>

> I used the lightbulb at the top right-hand-side of the file to disable

> HTML error checking for this file but that didn't have any effect.

>

> Again, attached three screen shots of the exceptions reported. While

> not an expert, this 'Hello World' jsp page looks to be valid with it

> just including a simple string expression.

>

> Thanks

>

> John

>

> ---------------------------------------------------------------------

> To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org

> For additional commands, e-mail: users-h...@netbeans.apache.org

>

> For further information about the NetBeans mailing lists, visit:

> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

---------------------------------------------------------------------

To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org

For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:

https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to