문제

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?

도움이 되었습니까?

해결책

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

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top