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 120828 - consider disabling html parser based features in templating context
Summary: consider disabling html parser based features in templating context
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: Sun All
: P3 blocker (vote)
Assignee: issues@javaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-01 15:48 UTC by Jindrich Sedek
Modified: 2016-07-07 08:55 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
footer (174.32 KB, image/png)
2008-01-18 08:41 UTC, Jindrich Sedek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jindrich Sedek 2007-11-01 15:48:09 UTC
Create new JSP file
use this code:
-------------------------------------------------------------------
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:choose>
    <c:when test="${customer.country == 'USA'}">
        <div style="color:blue">
    </c:when>
    <c:when test="${customer.country == 'Canada'}">
        <div style="color:red">
    </c:when>
    <c:otherwise>
        <div style="color:green">
    </c:otherwise>	
</c:choose>
CODE COLORED ACCORDING TO CUSTOMER COUNTRY
</div>
---------------------------------------------------------------------
first two div tags are underlined as unfinished, but the code is correct, because in HTML after processing just one of 
them will be
Comment 1 Marek Fukala 2007-11-01 23:25:46 UTC
Jindro, please do not torture me with such issues. 

How can the editor know which or how many of the <div> tags will be in the generated page??? You cannot determine what
will be the result of the runtime page execution.

Please....... :-)
Comment 2 Jindrich Sedek 2007-11-02 08:35:38 UTC
I understand the problem that we are not able to determine the runtime execution, but we should not show warning if we
are not sure there is some problem in user's code. It's quite bothering to look on you well written web page and see
warnings or errors in editor... The same can happen using imports or scriptlets... We should think of such problem at
least in the future... 
Comment 3 Marek Fukala 2007-11-02 12:35:30 UTC
That would mean disable all html parser based features in templating languages, sure, it is an option. If you have a
better idea go on and let me know, thanks.
Comment 4 Jindrich Sedek 2007-11-02 12:48:16 UTC
there are cases, where we can find a problem while parsing HTML - in fresh HTML subtree, but we can not find problems
when HTML tree is broken by some other language, would it be possible to check just parts of HTML code that are continual?
Comment 5 Marek Fukala 2007-11-02 13:06:01 UTC
This could cause user confustions IMHO, sometimes error would be show, sometimes not on the same html code (with just a
small piece of jsp or el). Jindro, can we discuss this in person next week? I will definitively not do anything related
in 6.0, sorry.
Comment 6 Jindrich Sedek 2008-01-18 08:41:13 UTC
There are many reports from users about this problem. I would propose at least add some option to disable this feature 
for users request. 
See my jspf file, that serves as footer - all end tags are started in page header or sidebar.
Comment 7 Jindrich Sedek 2008-01-18 08:41:44 UTC
Created attachment 55232 [details]
footer
Comment 8 Marek Fukala 2008-01-18 09:09:14 UTC
I agree that under some circumstances the errors and warnings should be disabled. The question is how the UI should look
like. 

1) action in the editor popup menu
2) action in the annotation popup menu
3) action on the file status icon
4) some other UI?

I can easily do #1 and maybe #2, the setting would be saved per file. The question is whether shouldn't be considered in
some wider context (not only html can have this problem IMO).
Comment 9 Martin Balin 2016-07-07 08:55:39 UTC
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