• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Naming convention for JSP File

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

Do we have a standards on how to name JSP Files. or we just name them the way we want.

thanks.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not believe that any one convention has attained pattern status. I tend to use all lowercase to avoid casing issues across operating systems, and make sure that the names are descriptive.
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Browsing the internet, I always notice when a URL ends in the word Servlet or .do or .jsp. I always note the way the JSP files are named.

I see many places follow the rule of naming JSP files the same way method names or variable names are named. Not sure why, since a JSP is really a Servlet class, so I'd figure class naming would more logically apply, but that's what I see.

Now, I have two thoughts on this:

1. URLs are typically all lowercase. Even looking at the JavaRanch URL, all the letters seem to be lowercase, although it's not a Java app, but that's another story.

2. Since urls are not type-checked, and you can't be positive of consistent casing through design-time checking, I say just make them lower case. In fact, any time there is a String that is not design-checked, my rule is to always make it lower case. I really hate tracking down NullPointerExceptions, only to find out that someone used an all upper case letter parameter name in an HTML form, but an all lowercase name in the Servlet obtaining the user input.

But, these are just opinions, and there is compelling evidence that indicates that many of my opinions are wrong.

Cheers!

-Cameron McKenzie
 
Cyrus Serrano
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi bear,

what's with the OS issue?

thanks
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Cyrus Serrano:
hi bear,

what's with the OS issue?

thanks



Unix derived OSs (Linux, OSX, Solaris, etc..) are case sensitive.
Windows is not.

This can lead to problems if you have two files one named 'myFile.jsp' and another named 'myfile.jsp'.

Using lower case for all of them eliminates any confusion.
 
Cyrus Serrano
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Ben.. c",)
 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:


Unix derived OSs (Linux, OSX, Solaris, etc..) are case sensitive.
Windows is not.

This can lead to problems if you have two files one named 'myFile.jsp' and another named 'myfile.jsp'.

Using lower case for all of them eliminates any confusion.



How???

And using all lower case reduces readability, IMO.

What's the issue with 'myOwnFile.jsp'???
 
reply
    Bookmark Topic Watch Topic
  • New Topic