"Duffey, Kevin" wrote:
>
> Is it possible to pass in any Object other than a String to a taglib? I
> thought something like:
>
> <x:myTagLib attr1="<%= new Object() %>" attr2="<%= new Vector() %>"/>
>
> would be perfectly legal. As someone pointed out to me, the <%= %> returns a
> String type.

The example above is perfectly legal, assuming that the custom action
attribute is declared as accepting a "request-time attribute value" in the
TLD:

  ...
  <attribute>
    <name>attr1</name>
    <rtexprvalue>true</rtexprvalue>
  </attribute>
  ...

When you use a JSP expression to set an attribute value like this, it is
*not* converted to a String (as opposed to when you use a JSP expression
anywhere else in the page).

> Is there another way to pass in an object other than String?
> Seems odd to me since JSP turns into a servlet that it cant call a taglib
> (java code) with objects other than String.

The below link contains a bit more information:

  <http://TheJSPBook.com/faq/details.jsp?id=1000>

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com

===========================================================================
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