struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Nenning <Christoph.Nenn...@lex-com.net>
Subject Re: Anyway to map properties to different request names?
Date Thu, 06 Nov 2014 08:46:25 GMT
> Paul Benedict <pbenedict@apache.org> kirjoitti 5.11.2014 kello 22.54:
> > It bothers me that the Java programming model dictates the parameter 
names.
> > In theory "personId" could be sent as "a" -- although a variable named 
"a"
> > in Java is bad naming conventions. There isn't a good technical reason 
to
> > keep this 1:1 mapping. The shorter the bytes sent too the better.... 
And in
> > reverse, if one is working on re-implementing an existing 
servlet/service,
> > you have to give poor names to your Java model to match existing form 
names.
> 
> 
> One simple (but perhaps ugly?) way is to provide also page-specific 
> setters along with the usual JavaBean-setters:
> 
> // Page provides personId using the name ”a”.
> public final void setA(String personId) { ... }
> 
> // JavaBean-version (if also needed)
> public final void setPersonId(String personId) { ... }
> 
> -Heikki
> 


This would be my suggestion, too.


Regards,
Christoph


This Email was scanned by Sophos Anti Virus
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message