On 8/23/06, Paul Benedict <[EMAIL PROTECTED]> wrote:
Ted Husted wrote: > Use "action-id" then. The point is that moniker "alias" is going to > cause confusion, since it already means something entirely different > within the Struts 2 community. Right now attributes are squarely mapped to properties. Java does not allow dashes in a property name, so what is a workaround?
One way to deal with this would be to provide your own BeanInfo class that defined a property named "action-id" with the getter and setter methods that you want to use. That way, the JavaBeans introspection logic would use your setter method, instead of not recognizing this as a property. But that's likely to be too painful for this kind of use. The other approach, if you're using something like Digester (which is true at least for S1) to parse the config file, is to define an explicit rule that calls the right setter if there is an attribute with a specified name. Craig