Question

I'm use NetBeans 8 for my new Maven Java Web project. The code generation really helps.

But, how Am I supposed to rename the extension of a file?

hello.jsp --> hello.xhtml

NetBeans "rename" only allow to change the first part, not the extension. Do I really have to go to my system-folder and change the file there?

Was it helpful?

Solution

You have to edit the properties. Right click on the file -> Properties.

A dialog will open where you can change the extension and more.

OTHER TIPS

you can't change the fileExtension with rightClick, when the file is open! close the editTab and then u can change the extension.

When the file is open, u get with rightClick/Properties other options!

Rename the file outside of Netbeans using a file browser for your OS and the extension will automatically change in Netbeans.

When you install the Files In Explorer plugin for Netbeans you can quickly open the folder from within Netbeans by right clicking the folder and selecting "Open in System Browser". From there you can rename the file extension.

To my knowledge, you can't change the extension. In NetBeans you create an object and work with that; there's no method to convert that into another type of object.

To solve your problem, you can create a new hello.xhtml object and copy the code. Or change the extension on the file system, outside of NetBeans.

It is also possible to provide a desired extension when you save a copy of an already opened file. Afterwards you can delete the file with the wrong extension.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top