DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14706>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14706

multiple setters

           Summary: multiple setters
           Product: Struts
           Version: 1.0.2 Final
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Controller
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I prefer having the option to set a value with multiple setters, hiding the
actual datatype within the class. This is one of the cardinal principals of
Object Oriented Programming, Polymorphism. Struts ActionForm and the bean 
taglib fail when there are multiple setters.  I get the error,
package_name.html.BEAN.

My preferrd method of polymorphism, hiding the datatype within the class:
public class Foo {
   String var;

   public Foo(int v) {}
   public Foo(String v) {}
   public void setVar(String v) {}
   public void setVar(int v) {}
}

Moving data in and out of a JSP, you will always have a String.  Through
reflection you will find the setter methods that corresponds to
the value in the JSP.  If there is one that uses a string, use it, otherwise
look for one you can convert your string to.

If I've overlooked something in the functionality of Struts and this actually
works, I'll be delighted.  If not, please consider allowing polymorphism
in the names of the setters.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to