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.
I've been using NB 6.01 for several months. I was using it earlier today. Then I installed NB 6.1. When editing a JSP file, on a new blank line I type ag<tab> and the "ag" code template does not get expanded. A <tab> gets inserted after the "ag" instead. I'm using Windows XP SP2 with JDK 1.6.0_06. If I quit 6.1 and bring up 6.0.1, the code templates work. There's no problem when editing Java code. I could go to Tools -> Options -> Code Templates, scroll to the desired template and select it, select all the text for the template, and use ctl-C to copy it into the clipboard, but that's extremely cumbersome. It actually works better to keep a gvim (editor) session listing my templates and using copy/paste.
I think the problem is in mime-types, in html part of jsp there are working code templates from language HTML, in the java parts, commonn java abbreviations can be used. This brings me to the question: Isn't language JSP in code templates options redundant?
> This brings me to the question: Isn't language JSP in code templates options redundant? I think, they are not. There can be templates specifically useful for writing JSP tags/code that have no meaning in plain HTML. We should be able to offer these in HTML sections of a JSP file.
It sure would be nice to have a fix for this. Our site uses a lot of common JSP elements. I use fill-in- the-blanks. And there's a nasty problem on 6.0.1 on Windows that keeps adding and adding blank lines to Code Templates that makes Code Templates only slightly more useful than on 6.1, where they don't work at all.
mbarnes: have you tried to move the templates to language html if they are supposed to by uses within html code or to language java, if they should be used inside java code?
Well, duplicating the code templates as HTML templates does seem to work. Is there a way to move them all, without having to enter, copy, and paste each, one-by-one???
I think you could do the following: 0. Shutdown the IDE and backup your userdir 1. In your userdir create the following folders: config/Editors/text/x-jsp/text/html/CodeTemplates/Defaults 2. In the above folder create 'codetemplates-hack.shaddow' file 3. Make sure that the file has only one line with the following content 'Editors/text/x-jsp' and the file's encoding is UTF8. You can now start the IDE and try JSP templates in HTML parts of a JSP file. They should work now. Please let me know if it works.
http://hg.netbeans.org/main/rev/8608885d6877
Integrated into 'main-golden', available in NB_Trunk_Production #243 build Changeset: http://hg.netbeans.org/main/rev/8608885d6877 User: Vita Stejskal <vstejskal@netbeans.org> Log: #134205 (fixed): enabling jsp code templates in HTML sections of JSP files