1. Create web project
2. create servlet
doGet and doPost methods are folded as desc="HttpServlet methods...
But if user generate another methods (e.g. rightclick->enterprise resource->send JMS Message), these methods are folded
in the same "block" as doGet and doPost and are collapsed by default. This may be confusing.
I suggest to place these new methods somewhere before "doGet & doPost block"..so its not collapsed automatically.
it looks more like a defect rather then enhancement
Priority correct at P3. Not critical for 6.1.
Reproduced in 6.1 dev build on WinXP.
The generated code is placed after folded block only in there is some code after the block (variable declaration is
sufficient). It seems that cursor position does not influence where the generated code goes.
I looked through NB APIs used for Java source code modification (a lot of compilation trees and diffs) and don't see any
way how to fix the problem using these APIs. However, I found that the problem may be eliminated just by changing
template for servlet code generation...
The fix is very simple and everybody may apply it to his/her NetBeans installation -- just change template for servlet
(1) Tools > Templates > Web > Servlet > Open in Editor.
(2) Modify the template according to the diff (see the link above). The most important change is to attach "//
</editor-fold>" comment directly after "}".
(3) Save the template.
Now all new methods should be inserted outside of the folded methods.
*** Issue 117977 has been marked as a duplicate of this issue. ***
The fix has been ported into the release61_fixes branch.