This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 232509 - Incorrect detection of JSON jsp file as being HTML
Summary: Incorrect detection of JSON jsp file as being HTML
Status: RESOLVED INVALID
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: issues@javaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-10 12:24 UTC by ecerichter
Modified: 2013-07-10 13:08 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of the issue (37.57 KB, image/png)
2013-07-10 12:24 UTC, ecerichter
Details
JSP file that produces a JSON output (780 bytes, text/plain)
2013-07-10 12:25 UTC, ecerichter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ecerichter 2013-07-10 12:24:29 UTC
Created attachment 136946 [details]
Screenshot of the issue

I've a JSP file that returns a JSON output.
NetBeans insists in parsing it as HTML file, providing validation errors for it.
Comment 1 ecerichter 2013-07-10 12:25:28 UTC
Created attachment 136947 [details]
JSP file that produces a JSON output
Comment 2 Vladimir Riha 2013-07-10 12:36:25 UTC
I don't think this is a bug. You have 4.01 Strict DTD used (according to the tooltip text) and inside the JSP you have code (text in this case and tags from JSTL core) that is not 4.01 Strict compliant. I think case with JSTL core tags is covered in issue 232439. It is like having PHP code in Java file, you cannot blame editor for marking PHP code as error as well. 


You can either change doctype to more benevolent HTML5 (does not help completely), or disable HTML validation.
Comment 3 ecerichter 2013-07-10 12:58:37 UTC
(In reply to comment #2)
> I don't think this is a bug. You have 4.01 Strict DTD used (according to the
> tooltip text) and inside the JSP you have code (text in this case and tags from
> JSTL core) that is not 4.01 Strict compliant. I think case with JSTL core tags
> is covered in issue 232439. It is like having PHP code in Java file, you cannot
> blame editor for marking PHP code as error as well. 
> 
> 
> You can either change doctype to more benevolent HTML5 (does not help
> completely), or disable HTML validation.

Page Content type is set to "application/json".
Is anything else I'm missing?
I don't want this page to be html at all, neither 5, or 4, or 3...
Comment 4 Vladimir Riha 2013-07-10 13:08:26 UTC
If you click on the bulb icon at line 21 on your screenshot, you can disable HTML checking for this file/project. I believe the contentType is used by editor only for possible encoding (if pageEncoding is not used)