• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Naming Conventions for XHTML and BackingBeans

 
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are there any naming conventions for .xhtml files and for backing beans?

For example, should a .xhtml file being with lower or upper case?

Thanks.
 
Saloon Keeper
Posts: 28756
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I prefer camel-case for the xhtml filenames myself, but if there's an actual recommended standard, I missed seeing it.

Backing beans are another matter entirely. If you use JSF2 annotations, the default name applied to the bean will be the bean's classname with the first character lowercased. Beginning a bean name with an upper-case letter is inadvisable, because only Classes should do that, not Instances, per standard Java conventions.

I normally like to suffix my bean classnames with "BackingBean". It's a bit redundant, since they're usually already located under a "backingbean" package level, but it does ensure that you don't end up with things like "com.x.backing.MyBean", "com.x.persistence.model.MyBean", "com.x.utils.jsf.validator.MyBean" and end up all confused when you see the simple name without knowing the exact context.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic