Hi,

Can anybody help clarify how a JSP container should handle
overloaded setters in a custom tag:

  public void setData(List dataList) {
    this.dataList = dataList;
  }
  public void setData(Object dataObj) {
    this.dataObj = dataObj;
  }
  public void setData(String dataStr) {
    this.dataStr = dataStr;
  }

We want to give the JSP author the convenience of passing data
to a tag using different types, whichever comes in more handy.
The data would be of the same "logical" kind, that's why, ideally,
the setters would bear the same name, just like overloaded methods
in Java.

As an example, JRun 3.1 accepts the code above, whereas Tomcat
3.2.3 throws a CompileException ("Unable to convert a String
to java.util.List").

What's the correct behavior?

Thanks,

-- Oliver

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to