struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daffin, Miles (Company IT)" <Miles.Daf...@morganstanley.com>
Subject Constants for property names
Date Thu, 10 Feb 2005 17:30:40 GMT
Hi All,
 
What do people feel about using constants for property names?
 
In general I feel one should use constants for such things, but it is
far from easy in a web app to do so.
 
If I define a constants class (e.g. com.plok.app.constants.Keys) I can
use this in everywhere in java code and in *most* (not all) places in
the jsps. For example this works: 
 
<html:text property="<%=Keys.Section0.APPLICANT_NAME%>"/>
 
but this does not:
 
<jsp:param name="<%=Keys.APPLICANT_NAME%>" value="What Ever"/>
 
I have the same problem if I want to refer to this property in any of
the following places:
 
- jstl tags
- xml files (e.g. struts-config, validation)
 
Do you see what I mean?
 
 
So, what am I doing/thinking wrong? Should I forget about defining
constants? 
 
Am I getting my knickers in a twist over nothing?
 
-Miles
 
Miles Daffin
Morgan Stanley
20 Cabot Square | Canary Wharf | London E14 4QA | UK
Tel: +44 (0) 20 767 75119
miles.daffin@morganstanley.com <mailto:miles.daffin@morganstanley.com> 
--------------------------------------------------------
 
NOTICE: If received in error, please destroy and notify sender.  Sender does not waive confidentiality
or privilege, and use is prohibited. 
 

Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message