Is there an industry-standard naming convention for JSP files?
I have come across three conventions from different sources:
All lowercase (thisismyfile.jsp)
Camel case with the first letter lowercase (thisIsMyFile.jsp)
Camel case with the first letter uppercase (ThisIsMyFile.jsp)
A JSP file is a Java document used to dynamically generate a webpage using Jakarta Server Pages (JSP) functions. It is similar to an . ASP or . PHP file, except it contains Java code instead of ActiveX or PHP.
File naming best practices:Avoid special characters or spaces in a file name. Use capitals and underscores instead of periods or spaces or slashes. Use date format ISO 8601: YYYYMMDD.
A JSP page is a text document that contains two types of text: static data, which can be expressed in any text-based format (such as HTML, SVG, WML, and XML), and JSP elements, which construct dynamic content. The recommended file extension for the source file of a JSP page is .
Updated Answer - 2019
Since this question was first answered, it looks like Oracle has added a naming convention section to their document: https://www.oracle.com/technetwork/articles/javase/code-convention-138726.html
JSP Names
A JSP (file) name should always begin with a lower-case letter. The name may consist of multiple words, in which case the words are placed immediately adjacent and each word commences with an upper-case letter.
So thisIsMyFile.jsp
(above) is the choice that best matches the convention.
Original Answer from 2013
Here's the closest thing I could find to an official naming convention: http://www.oracle.com/technetwork/articles/javase/code-convention-138726.html.
It appears that Sun/Oracle has no opinion on the filenames.
My 2 cents: I prefer to go all lower case. It minimizes the likelyhood of porting problems. For example porting from Windows to Unix (a case-sensitive operating system) could result in case issues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With