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 138840

Summary: scriptlet code completion doesn't work if the scriptlet is not closed
Product: javaee Reporter: Jindrich Sedek <jsedek>
Component: JSPAssignee: Tomasz Slota <tslota>
Status: RESOLVED FIXED    
Severity: blocker CC: mfukala, mschovanek, pjiricka
Priority: P3    
Version: 6.x   
Hardware: Sun   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Jindrich Sedek 2008-07-02 17:38:51 UTC
Create new WebApplication
use this code in index.jsp:
--------------------
<%! String str = "HELLO"; %>
--------------------
on next line start typing:
<% |

invoke cc, select "str", 
type "."
you have <% str.|
invoke cc -> just few keywords are proposed, but String methods should be offered

closing scriptlet to <% str.| %> helps and code completion starts working, but we should be able to recover the 
situation of unclosed scriptlet. It is expected scenario typing text from the beginning and closing scriptlet at the 
end of typing the code.
Comment 1 Tomasz Slota 2008-08-06 09:36:01 UTC
Confirmed. It will be rather difficult to fix though, we'll need smth like code sanitation for JSP.
Comment 2 Jindrich Sedek 2009-04-10 13:19:29 UTC
it's hard to use java in JSP's with this bug, there is an easy workaround, but while not knowing it, cc in scriptlet 
doesn't work at all
Comment 3 Petr Jiricka 2009-07-02 17:54:05 UTC
Is this a regression, or did it never work?
Comment 4 Jindrich Sedek 2009-07-02 18:06:45 UTC
I think it worked before 6.0, but probably not since that time.
Comment 5 Tomasz Slota 2009-07-02 21:06:06 UTC
It seems to work fine now as long as there is a prefix, e.g.

<%! String str = "HELLO"; %>
<% S|

completes OK. On the other hand there is no CC if there is no prefix even if there is a closing scriptlet tag, e.g.

<%! String str = "HELLO"; %>
<% | %> - no CC

I think there is a prefix in most real-life use cases, besides a fix in this area would be risky for the patch.
Comment 6 Marek Fukala 2010-05-13 14:27:11 UTC
(In reply to comment #5)
> It seems to work fine now as long as there is a prefix, e.g.
> 
> <%! String str = "HELLO"; %>
> <% S|
> 
> completes OK. On the other hand there is no CC if there is no prefix even if
> there is a closing scriptlet tag, e.g.
> 
> <%! String str = "HELLO"; %>
> <% | %> - no CC
> 
> I think there is a prefix in most real-life use cases, besides a fix in this
> area would be risky for the patch.

both cases works for me now, closing as fixed