Bug 412043 - .JSP files open with the plain text editor even after setting JSP editor as default
Summary: .JSP files open with the plain text editor even after setting JSP editor as d...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-01 13:19 EDT by Martin Carney CLA
Modified: 2020-09-25 03:55 EDT (History)
4 users (show)

See Also:


Attachments
Screenshot of "Open With" context menu (35.58 KB, image/png)
2013-08-01 18:24 EDT, Martin Carney CLA
no flags Details
Eclipse's preferences export from a workspace displaying the bug in question (51.99 KB, text/plain)
2013-08-13 12:02 EDT, Martin Carney CLA
no flags Details
Content type default editor button missing (101.37 KB, image/jpeg)
2020-09-24 08:17 EDT, Gert Matern CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Carney CLA 2013-07-01 13:19:13 EDT
Expected behavior:
Opening a .jsp or .jspf file will load the file into a JSP Editor pane.

Actual behavior:
Opening a .jsp fill loads the file into a plain text editor pane.
I modified General > Editors > File Associations to make sure that JSP Editor is the top item in those files' associations, and marked it as the default, too. Even with those changes, JSPs still open in plain text editor.

Steps to reproduce:
1. Download and unzip the Windows 7 64-bit "Eclipse IDE for Java EE Developers" version of eclipse.
2. launch eclipse and navigate to a .jsp file in Navigator or Project Explorer pane.
3. double-click the .jsp file.
4. The file will open in a plain-text editor instead of a JSP editor.

Possible oddities:
I used Windows 7's built-in zip functionality instead of a 3rd party program like 7-zip. I've heard this can be a source of problems.
I have a Tomcat plugin installed to quickly stop and start a local Tomcat server.


-- Configuration Details --
Product: Eclipse 2.0.0.20130613-0530 (org.eclipse.epp.package.jee.product)
Installed Features:
 org.eclipse.platform 4.3.0.v20130605-2000
Comment 1 Martin Carney CLA 2013-07-01 14:39:56 EDT
It looks like several file types are going to the default text editor. Formats I've run into so far:
.xml (should go to XML editor)
.js (should go to JavaScript editor)
Comment 2 Paul Webster CLA 2013-07-04 14:05:03 EDT
Is this an existing workspace, or a fresh workspace with your source checked out of SCM?

PW
Comment 3 Martin Carney CLA 2013-07-04 15:19:27 EDT
I'm using an existing workspace brought over from Juno. I could try creating a new workspace and see if that resolves the issue.
Comment 4 Martin Carney CLA 2013-07-05 17:23:14 EDT
I tried creating a new workspace, cloning and checking out from scratch, and the bug still remains.
Comment 5 Martin Carney CLA 2013-07-09 14:35:50 EDT
It seems that once I have used Open With -> Other... on a file to open it with the right editor, it remembers the chosen editor type, but only for that one file.
Comment 6 Paul Webster CLA 2013-07-18 13:32:20 EDT
In your fresh workspace where you can reproduce the problem, what are the defaults listed for jsp files?

i.e. in Preferences>General>Editors>File Associations.  In Preferences>General>Content Types.  and finally when you right-click on the .jsp file (before having selected anything) what does it list under Open With>?  On a java file for example it lists Java Editor then Text Editor.

PW
Comment 7 Martin Carney CLA 2013-08-01 18:24:30 EDT
Created attachment 234041 [details]
Screenshot of "Open With" context menu

Preferences>General>Editors>File Associations: *.jsp has listed {JSP Editor (default), Text Editor, Web Page Editor }. *.jspf has listed {JSP Editor (default), Text Editor}

In Preferences>General>Content Types
There are not items for JSP files. It only has {Java Archive, Java Class File, Text, and Word Document}.
Comment 8 Paul Webster CLA 2013-08-12 12:40:27 EDT
Can you export your prefs and attach them here?

File>Export...>Preferences 

You should just select All preferences.

PW
Comment 9 Martin Carney CLA 2013-08-13 12:02:00 EDT
Created attachment 234365 [details]
Eclipse's preferences export from a workspace displaying the bug in question
Comment 10 Martin Carney CLA 2015-06-17 14:14:08 EDT
I have not experienced this since upgrading to Luna.
Comment 11 Viccy Lu CLA 2019-09-20 18:33:02 EDT
I still have the same problem.

I have Eclipse version 2018-09 (4.9.0)

No matter what I do, I cannot open a new file with JSP Editor.  I have tried to set file association to default to JSP Editor many times.  Never works.  Use open with and then click  the box open all .jsp files with this editor (JSP Editor) has no effect either.
Comment 12 Nitin Dahyabhai CLA 2019-09-21 22:35:52 EDT
(In reply to Viccy Lu from comment #11)
I'm not sure if you meant to imply you've had this problem since 2013, but the JSP Editor is installed, set as the default, and still not opening? Can you attach screenshots showing this, and what opens instead?
Comment 13 Achim Schupeta CLA 2019-10-04 11:19:41 EDT
I have a similar Problem (Eclipse version 2019-09 = 4.13.0) and it goes like this:

I'm using Subversion-Repository (SVN) with Subclipse and have several .jsp files within my project.

Opening any of these .jsp's in Eclipse works fine:  
JSP Editor renders correct and even code completion works fine.
But:
As soon as I open 'Show Annotation...'  (this is: mouse right klick --> Team --> Show Annotation...) 
that same file is opened in a new txt-Editor without rendering, without any features except of showing the Annotations.

May be it has something to do with my Subclipse? 
May be this could help debugging the strange behavior reported by Viccy Lu?
Comment 14 Viccy Lu CLA 2020-05-24 12:44:37 EDT
I still have the same problem.  I just upgraded to Eclipse 2020-03.

No matter what I do, my .jsp files open in plain text even though JSP Editor is set as default.  Choosing open with and manually picking JSP Editor will open the files correctly, but manually doing this every time is very annoying!!

Can someone give an answer on what's causing this?

Thank you so much!

YL
Comment 15 Nitin Dahyabhai CLA 2020-05-24 14:36:15 EDT
(In reply to Viccy Lu from comment #14)
Viccy, when you open the Properties dialog for one of those files, does the Resource page correctly list the file's Type as "File  (JSP)"? When the file defaults to opening in a different editor, which one has become the default in the file's Open With context menu--exactly which name is shown as the default?
Comment 16 Viccy Lu CLA 2020-05-24 16:36:58 EDT
Hi Nitin,

The properties -> resource of a .jsp file will show the type as File (JSP).  If I use open with, the default is Generic Text Editor.

Thanks.
Comment 17 Nitin Dahyabhai CLA 2020-05-27 02:03:14 EDT
(In reply to Viccy Lu from comment #16)
> Hi Nitin,
> 
> The properties -> resource of a .jsp file will show the type as File (JSP). 
> If I use open with, the default is Generic Text Editor.

Thank you! Other than how the editor class itself is specified (which only changed for 2020-06), we haven't changed how the JSP Editor is registered since long before Juno.
Comment 18 Viccy Lu CLA 2020-05-27 18:49:57 EDT
What could the problem be then?  I know it doesn't happen to everyone.  But it does happen for me.
Comment 19 Gert Matern CLA 2020-09-24 08:14:04 EDT
Having a little different problem, which might be related to this , otherwise move it as a new issue: 
installed JBoss-Tools had added jboss-editor for jsp files, but eclipse doesn't show anymore the default button for selecting the standard jsp-editor, see attachment.

Eclipse IDE for Enterprise Java Developers (includes Incubating components)
Version: 2020-09 (4.17.0)
Build id: 20200910-1200
OS: Windows 10, v.10.0, x86_64 / win32
Java version: 14.0.2
Comment 20 Gert Matern CLA 2020-09-24 08:17:56 EDT
Created attachment 284248 [details]
Content type default editor button missing
Comment 21 Nitin Dahyabhai CLA 2020-09-24 08:42:05 EDT
(In reply to Gert Matern from comment #20)
> Created attachment 284248 [details]
> Content type default editor button missing

That would be on the File Associations preference page.
Comment 22 Gert Matern CLA 2020-09-25 03:44:43 EDT
Ok, thx for directing me to the right page, but even when setting the internal JSP editor as default, eclipse opens th jsp file with a blank page, no editor. It seems as if it can't find the default anymore. Only when opening explicitly with default from the right mouse button it now works.
Comment 23 Gert Matern CLA 2020-09-25 03:55:55 EDT
Additional info: this happend only, because I still had the blank pages open and was directed there when clicking same jsp again. 

The file association page works!

Sorry for starting confusion here!!!