jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eduardo Pelegri--Llopart <Eduardo.Pelegrillop...@eng.sun.com>
Subject Re: Cooperation
Date Mon, 24 Jul 2000 13:55:46 GMT
Tag handlers are based on the JavaBenas model.  So, if you want to make
the attributes available, you will need properties with the same name. 
In your case the default methods would be, setObject(String) and
setSince(String) [plus String getObject() and String getSince()]

Did I get the question right?  Hope this helps,
	- eduard/o

"Shaw, Kendall" wrote:
> 
> Hi,
> 
> I'm having trouble getting started on my tag library. Since it's rather
> quiet here, I hope it's alright if I ask a novice question:
> 
> I want to allow for this type of document:
> 
> <starteam:server host="starteam" port="1024">
>  <starteam:project>
>   <starteam:projectName>Squander</starteam:projectName>
>   <starteam:projectName>Pillage</starteam:projectName>
>   <starteam:promoted object="label" since="thursday">
>    <tr>
>     <td><b><%=label.projectName()%></b></td>
>     <td><%=label.name()%></td>
>     <td><%=label.date()%></td>
>    </tr>
>   </starteam:promoted>
>  </starteam:project>
> </starteam:server>
> 
> So, I've created classes:
> 
> ServerTag extends TagSupport
> ProjectTag extends TagSupport
> ProjectNameTag extends BodyTagSupport
> PromotedTagExtraInfo extends TagExtraInfo
> PromotedTag extends BodyTagSupport
> 
> I expect this to work this way:
> 
> ServerTag keeps the host and port values
> ProjectTag keeps a list of project names
> ProjectNameTag adds to the list in Project
> PromotedTag constructs an object which connects to the server, and iterates,
> evaluating the body.
> 
> Now, I need to pass information to the constructor for the object in
> PromotedTag. So, how does this take place? I have something like this:
> 
> public class PromotedTagExtraInfo extends TagExtraInfo {
>   public VariableInfo[] getVariableInfo(TagData data) {
>     String object = getAttributeString("object");
>     if (object == null)
>         object == new String("label");
>     return new VariableInfo[]
>       { new VariableInfo(object, "Blather", true, VariableInfo.NESTED) };
>   }
> }
> 
> Can I get access to this object in PromotedTag? Does getVariableInfo
> contstruct the object?
> 
> Kendall

Mime
View raw message