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.
Use following code in JSP file (GlassFish 3.1.2, Java EE 6 Web): ==START <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <jsp:useBean class="java.util.Date" id="mm" scope="request"/> <% mm.getD <body> <h1>Hello World!</h1> </body> </html> ==END - Invoke cc for the "mm.getD", select getDate() and press Enter => nothing happens. The same goes for getTime(), surprisingly getClass() works fine. If I close the scriptlet tag ("%>") and invoke cc again, it works Product Version: NetBeans IDE Dev (Build 201206110001) Java: 1.7.0_04; Java HotSpot(TM) Client VM 23.0-b21 System: Linux version 3.0.0-20-generic-pae running on i386; UTF-8; en_US (nb)
Another case: <% mm. Invoke cc, select and confirm "after(when)". Result: => <% mm.(when) Again, closing %> helps Product Version: NetBeans IDE 7.2 RC1 (Build 201206252201) Java: 1.7.0_06-ea; Java HotSpot(TM) Client VM 23.2-b05 System: Linux version 3.0.0-21-generic-pae running on i386; UTF-8; en_US (nb)
Martin, could you please investigate this? Possibly a 7.2 patch candidate. Thanks.
(In reply to comment #2) > Martin, could you please investigate this? Possibly a 7.2 patch candidate. > Thanks. Hard to say whether to put it into patch or not. I'm a little bit afraid of possible regressions since I didn't know much jsp sources and there is only several tests. The completing works wrong since whole rest of the file is taken as a SCRIPTLET item which causes issues by using standard Java's completion infrastructure. Guess where the unfinished SCRIPTLET ends just in the JspLexer is probably impossible so the fix came to the generation of the simplified servlet for completion and Java is embedded there only to the cursor position (which suffers for this purpose). So if you think that the issue is severe enough, I think that it could go to the patch but it's really necessary to test a lot from QE this issue and for assurance also other code completion in the scriplets. Fixed in web-main #b77c3cab6cea.
Marek, we are waiting with the resolution whether the fix will go to the patch or not for testing by Lada. Anyway could you review that change for assurance in advance? The principle of that change is that the whole unfinished SCRIPTLET token, including HTML code behind, is passed to (created embedded source for) Java CC. And I didn't get an idea how to differ where the scriptlet ends in it the JspLexer - if possible at all. So if something like that happens (unfinished scriptlet) it is cut to the caret position (where we are btw. asking for the completion). Thanks a lot...
Integrated into 'main-golden', will be available in build *201208290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b77c3cab6cea User: Martin Fousek <marfous@netbeans.org> Log: #213963 - Code completion for bean in JSP can't finish for some methods
Thanks, it fixed the problem and other code completion also works as expected => verified
I'm afraid I cannot confirm the fix is ok. The idea of cutting the rest of the scriptlet after the caret is great, but as I'm looking it the diff I believe it happens also in correctly terminated scriptlets. In such case the diff may cause regressions as the code below the caret also matters. For example in scriptlet declarations you may define some methods which then goes the the servlet body. Having the fix as it is they wouldn't get to the generated servlet and some errors may pop-up, completion would be affected etc. In general the behavior of the java support would depend upon the caret position. I believe the "current" scriptlet should be tested for the presence of the end delimiter (%>) and the cut to the caret position should be done only if the scriptlet is unfinished (the sctiptlet token ends at the end of the file). BTW, please verify the behavior of following example: <% java code | --editing here ...html... <% java code 2 %> I'm not sure how the JspLexer creates the sctiptlet token (if it check presence of open scriptlet delimiter inside a scriptlet.
(In reply to comment #7) > please verify the behavior of following example: > > <% java code | --editing here > > ...html... > > <% java code 2 %> I have no problem with code completion or coloring but there is some (I don't if related, will try older build) problem that if you make some (syntax) error like missing semicolon then this error doesn't go away unless you: edit the 2nd one or reopen file. Is this the issue you are talking about?
(In reply to comment #8) > if you make some (syntax) error *in the first scriptlet
(In reply to comment #9) > (In reply to comment #8) > > if you make some (syntax) error > > *in the first scriptlet (In reply to comment #8) > (In reply to comment #7) > > please verify the behavior of following example: > > > > <% java code | --editing here > > > > ...html... > > > > <% java code 2 %> > > I have no problem with code completion or coloring but there is some (I don't > if related, will try older build) problem that if you make some (syntax) error > like missing semicolon then this error doesn't go away unless you: edit the 2nd > one or reopen file. Is this the issue you are talking about? No, that's completely different (wery well known, super hard to fix issue - synchronization between parsing.api tasks and jasper jsp parser) issue.
> I believe the "current" scriptlet should be tested for the presence of the end > delimiter (%>) and the cut to the caret position should be done only if the > scriptlet is unfinished (the sctiptlet token ends at the end of the file). Thanks for good catch and detailed review. Applied in: http://hg.netbeans.org/web-main/rev/f1aab9c4008c Vlado, could you give it also another try tommorow? Thanks.
of course, I'll try.
Integrated into 'main-golden', will be available in build *201208300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/f1aab9c4008c User: Martin Fousek <marfous@netbeans.org> Log: #213963 - Code completion for bean in JSP can't finish for some methods
carefully saying it's OK :) Sorry for delay, I didn't get a email from Bugzilla... Product Version: NetBeans IDE Dev (Build 201208300001) Java: 1.7.0_06; Java HotSpot(TM) Client VM 23.2-b09 System: Linux version 3.2.0-29-generic-pae running on i386; UTF-8; en_US (nb)
(In reply to comment #14) > carefully saying it's OK :) Sorry for delay, I didn't get a email from > Bugzilla... Thanks a lot Lado! I'll transplant it tomorrow.
Transplanted related changes into releases#release72 branch: changeset: 237344:c452240b2b31 description: #213963 - Code completion for bean in JSP can't finish for some methods (transplanted from b77c3cab6ceab41fd8f3eb965e0c801ca2f89f93) changeset: 237345:2c1883f9e46b description: updated comment (transplanted from 88eae207b9ccbb90a8dc85a6b5518052a9f01374) changeset: 237346:c3edec76c140 description: #213963 - Code completion for bean in JSP can't finish for some methods (transplanted from f1aab9c4008c4c056c6e420e140e456fe22bc870) changeset: 237347:17a32cc9f7b2 description: Spec. version and long description update for issue #213963
Integrated into 'releases', will be available in build *201209010822* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/c452240b2b31 User: Martin Fousek <marfous@netbeans.org> Log: #213963 - Code completion for bean in JSP can't finish for some methods (transplanted from b77c3cab6ceab41fd8f3eb965e0c801ca2f89f93)
seems fine in patch => verified Product Version: NetBeans IDE 7.2 (Build 201207171143) Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01 System: Linux version 3.2.0-29-generic-pae running on i386; UTF-8; en_US