Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File naming convention for JSP

Tags:

Is there an industry-standard naming convention for JSP files?

I have come across three conventions from different sources:

  1. All lowercase (thisismyfile.jsp)

  2. Camel case with the first letter lowercase (thisIsMyFile.jsp)

  3. Camel case with the first letter uppercase (ThisIsMyFile.jsp)

like image 287
OceanBlue Avatar asked Jan 09 '13 20:01

OceanBlue


People also ask

What format is JSP file?

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.

What is the best naming convention for files?

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.

What a JSP file contains?

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 .


1 Answers

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.

like image 85
EJK Avatar answered Sep 25 '22 05:09

EJK