Do this:
Pass the variable name as a value to the tag, just like the actual value.
<zp:authenticate var="<%=user%>" value="<%userName%>"/>
Peace,
Jay
----- Original Message -----
From: "Dror Matalon" <[EMAIL PROTECTED]>
To: "Jay" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, September 07, 2002 12:10 PM
Subject: Data from a tag library
> Hi,
>
> We're writing a custom tag library for our platform, and for the most
> part it's working quite nicely. When you want to set a java variable in
> a tag you do something like:
>
> <%
> int myVar = 5;
> %>
>
> <zp:foo bar="<%=myVar%>"/>
>
> How do you do the opposite, how do you fetch a var from a tag into your
> java code? I'd like to have a tag that fetches the user name and makes
> it available to the java code. Something like:
>
> <%
> String user = "";
> %>
>
> <zp:authenticate "<%=user%>"=userName/>
>
> <%
> if(userName.equals("joe"))
> ...
> else
> ...
> %>
>
>
>
> --
> Dror Matalon
> Zapatec Inc
> 1700 MLK Way
> Berkeley, CA 94709
> http://www.zapatec.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://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com