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.
Summary: | NetBeans false parsing error in jsp: Bad value .. for attribute "href" on element "a" | ||
---|---|---|---|
Product: | javaee | Reporter: | agallardo |
Component: | JSP Parser | Assignee: | issues@javaee <issues> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | agallardo, paulflakstad |
Priority: | P3 | ||
Version: | 7.1.2 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: | Screenshot: NetBeans parsing error for href attribute |
Description
agallardo
2012-05-14 19:11:59 UTC
This issue becomes very irritating, as in our JSPs we often build dynamically the "href" attribute. I have several files with too many of these distracting errors ("name" and "id" attributes for "a" element are also affected). I also cannot understand why it seems that I'm the only one affected by these issue: I don't think that my scenario is too exotic. Am I missing something or doing something wrong? Or has the NetBeans parser been upgraded recently causing a regression? (Regression that no one has still noticed as JSP is a relatively old technology.) Well, it is a bit embarrassing: I finally found the config option to turn off / tune this warning: Tools -> Options -> Editor -> Hints -> HTML Validator -> Attributes Changing it to "Enhancement," as it still holds true that the IDE should recognize that the attribute is built dynamically. I shouldn't need to turn off the validation for attributes off just because I'm editing JSPs. This also happens with form elements if the "action" attribute is a EL variable, for example this: <form name="my-post" action="${myArray['action']}" method="POST"> gives the error: -------------------------------------------------------------------------------- Bad value " " for attribute "action" on element "form": DOUBLE_WHITESPACE in PATH. Syntax of IRI reference: Any URL. For example: '/hello', '#canvas', or 'http://example.org/'. Characters should be represented in NFC and spaces should be escaped as '%20'. From line 19, column 9; to line 19, column 58 (Rule Category: Attributes) -------------------------------------------------------------------------------- This is extremely annoying when editing .jsp files! I just installed NetBeans 7.3.1, full version, no plugins. My JSPs are now riddled with this "error", whereas the very same files were all error-free in version 7.0.1. As far as I can tell, NetBeans won't allow a variable as an attribute's value. This surely cannot be the desired default behaviour of an advanced IDE. To reproduce the error: 1.) Create a JSP and define a String variable, e.g.: String myImgSrc = "http://url.com/image.jpg". 2.) Use the variable as an attribute value, e.g.: <img src="<%= myValue %>" /> Taglibs are also affected: <img src="<my:tag>/some/path/here</my:tag>" /> will produce the error. When it's not an attribute, all is fine. F.ex., <title><%= myTitle %></title> produces no error. PS: In Tools -> Options -> Editor -> Hints -> HTML Validator -> Attributes I see nothing, except for an empty "Language" dropdown and a search field I can't use for anything. Tested version 7.4 RC2. The issue is gone there. Well – almost... This line: <html lang="<%= getLanguage() %>"> Produced this (equivalent) error: Bad value " " for attribute "lang" on element "html": The language subtag " " is not a valid language subtag. Syntax of language tag: An RFC 5646 language tag consists of hyphen-separated ASCII-alphanumeric subtags. There is a primary tag identifying a natural language by its shortest ISO 639 language code (e.g. 'en' for English) and zero or more additional subtags adding precision. The most common additional subtag type is a region subtag which most commonly is a two-letter ISO 3166 country code (e.g. 'GB' for the United Kingdom). IANA maintains a registry of permissible subtags. This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss Thanks. I confirm that I cannot reproduce it in NetBeans 8. (In reply to agallardo from comment #7) > Thanks. I confirm that I cannot reproduce it in NetBeans 8. My fault: the error pointed out in comment #5 is still present. I filed https://netbeans.org/bugzilla/show_bug.cgi?id=262727 to track error reported in comment #5. |