Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 154466 - Insert Closing Brackets Automatically doesn't work in java embedded in JSPs
Insert Closing Brackets Automatically doesn't work in java embedded in JSPs
Product: java
Classification: Unclassified
Component: Editor
All All
: P3 with 1 vote (vote)
: 7.0
Assigned To: Dusan Balek
Depends on:
  Show dependency treegraph
Reported: 2008-12-03 15:05 UTC by trobbins
Modified: 2010-11-05 03:51 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description trobbins 2008-12-03 15:05:56 UTC
The 'Insert Closing Brackets Automatically' option does nothing in a JSP.  In JAVA code it does as it should. 
Furthermore, when hitting enter after entering the left brace, the cursor should not indent on the next line, but it does.

This results in me having to backspace everytime i enter a code block so  my right brace will be in line with the left
edge of my starting block.

NB 5 was smart enough to put that right brace in the right spot.

I am using a Free form web application
Comment 1 trobbins 2009-03-18 15:21:31 UTC
The issue can be seen with html code as well.  If you enter a tag, then hit Enter to go to the next line, the cursor
will indent, but it should not do this.
Comment 2 trobbins 2009-04-29 13:52:42 UTC
Any word on when this fix will be in?  It is a constant annoyance and time killer for me to always have to backspace or
shift-tab after entering my right-space to get it to be in the right place.  Let me clarify the bug description, in case
its not quite clear.

There are 2 issues at work here.  The first issue is that if i have the 'Insert Closing Brackets Automatically' option
enabled, the right parenthesis will be auto-inserted in java code, but not in a jsp.  

The 2nd issue is that when i enter my right parenthesis of a code block on a new line, it should automatically re-align
it to the left side of the block after i hit enter.  This worked fine in NB 5, but has never worked since.

If issue #1 is fixed, then issue #2 will not be so important for me.

As for the comment on html being broke, i found out why i saw that behavior, and it turns out everything is working fine
in that regard.
Comment 3 trobbins 2009-04-29 13:55:33 UTC
typo correction

'entering my right-space' should be 'entering my right parenthesis'
Comment 4 Marek Fukala 2009-04-30 12:26:39 UTC

Do I understand it right that the HTML editor behaviour is OK? For me it seems to be fine if the cursor is indented if
you press enter after an open tag. Then the tag content is indented as "in tag" and when you type the close tag the tag
aligns with the open tag.

As for the other problem I understand:

#1: curly bracket autocompletion doesn't work in java code embedded in JSP; to reproduce put <% | %> in a jsp file and
type { at the pipe position => no closing } bracket is added as in standalone java

#2: curly bracket indentation/aligning doesn't work; to reproduce (in a jsp scriptlet) type {, then enter => new line
indent level is increased, then type } => the } bracket is not aligned with the opening pair.

I think someone should look at the issues. Tomasz, you are the java-jsp expert, can you please look at this issue. If
you have no experience in this field, feel free to reassign to me.
Comment 5 trobbins 2009-04-30 13:42:09 UTC
I did some more testing on the html auto-indention and completion issues, to see what I could find.  I was able to find
a couple of screwy issues with NB 6.5.

After entering an opening tag and hitting enter, the closing tag will auto-fill.  If you then hit enter, it will be
properly aligned with the opening tag.  However, if you hit <spacebar> after entering the opening tag, then hit enter,
the tag will not-autocomplete, which is fine, IMO.  Instead, it will move the cursor to the next line, and the cursor
will be indented.  This is still fine.  But, when you go to enter the closing tag, then hit enter, the tag will not
auto-indent back to the left to be aligned with the opening tag.  This would be a bug, and is similar to how closing
brackets behave.  Also,  depending on the what html is in the page (i.e. - i can't reproduce it reliably), the
auto-indent for the closing tag will sometimes happen, but incorrectly.  For example, I often see it that the closing
tag will be a few tabs to the left of the opening tag.

As for your descriptions of the JSP scriptlet / bracket issues, those are correct.  I think NB should respect the
'Insert Closing Brackets Automatically' option in JSPS, and if the option is unchecked, then it should re-align the
closing tag, as it had done correctly in NB 5.
Comment 6 trobbins 2009-06-02 13:30:05 UTC
This issue has a target milestone of 6.7, yet this issue has not been fixed for NB 6.7 RC1.  Is anyone still working on
a fix for this for 6.7?
Comment 7 trobbins 2009-10-23 15:48:31 UTC
Any word on this?  I have just tested NB 6.8 Beta, and this issue has still not been addressed.  is this really so hard?
Comment 8 Marek Fukala 2009-10-26 11:12:03 UTC
trobbins, please specify briefly what still doesn't work. The JSP-java stuff or html end tag indentation?
Comment 9 trobbins 2009-10-26 13:38:06 UTC
I am concerned with the 'Insert Closing Brackets Automatically' issue in jsps.  You can forget about the html 
indention issue, not to say that it's fixed. Its just one of the those more rare, hard-to-reproduce issues that will 
only happen for me on certain pages, but I can live with it.  On the other hand, this bracket issue affects me all 
day, everyday, and it is an obvious bug.
Comment 10 Marek Fukala 2009-10-27 18:16:13 UTC
Looks like a productivity issue, Tomasz can you please look at it? Upgrading to P2 so it appears in your radar range.
Comment 11 Tomasz Slota 2009-10-28 00:16:20 UTC
Everything seems OK on the embedding side, reassigning to Java editor for further evaluation
Comment 12 David Strupl 2009-11-01 17:18:05 UTC
I don't think this is P2 bug (making it P3).
Comment 13 Dusan Balek 2010-11-04 10:54:38 UTC
Fixed in jet-main.
Comment 14 Quality Engineering 2010-11-05 03:51:29 UTC
Integrated into 'main-golden', will be available in build *201011050000* on (upload may still be in progress)
User: Dusan Balek <>
Log: Issue #154466: Insert Closing Brackets Automatically doesn't work in java embedded in JSPs - fixed.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo