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 - scriptlet code completion doesn't work if the scriptlet is not closed
Summary: scriptlet code completion doesn't work if the scriptlet is not closed
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: Sun All
: P3 blocker (vote)
Assignee: Tomasz Slota
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-02 17:38 UTC by Jindrich Sedek
Modified: 2010-05-13 14:27 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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