tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eduardo Pelegri-Llopart <pele...@eng.sun.com>
Subject configuration tags... (was XML configuration)
Date Thu, 14 Oct 1999 04:28:29 GMT
I just caught a piece of the exchange so all disclaimers apply but I
note that this is very similar to the final version of tag extensions in
JSP 1.1 (public early next week).

	<x:a att1="foo" att2="bar"/>

maps at runtime into a tag handler JavaBean component on which two
setters are applied h.setAtt1("foo") and h.setAtt2("bar") (say), and
then the method h.doStartTag() is invoked.

It is not strict XML, but I hope that, with the help of many people in
this group, by JSP 1.next we will have a complete story there.

	- eduard/o

> > b) Where does it tell me about att1/att2 in the example above?
> 
> Unfortunatly, that's where my example is Java specific -- I'm using
> reflection to pipe those straight into the class... For example,
> 
>     <newtask att1="foo" att2="bar"/>
> 
> I'd reflect into an instance of the class that is associated with "newtask"
> (in my previous email org.apache.reallycool.TaskClass) and use JavaBeans
> setter methods -- this means that I can use the java.beans.* library to find
> the method for setAtt1(String s) and setAtt2(String s) from that instance
> class without knowing its exact type. I set the attributes, and then, at the
> appropriate time (as it is a build system) I call an exec method that fires
> and uses whatever configuration was reflected into it to do it's job.
> 
> I don't know how to do this last part in C as I'm *not* a good C hacker (I
> had a different background that led me into Java...)
> 
> The problem of course with this example is that this isn't exactly the same
> way you'd do things for a server configuration file -- but I wanted to make
> sure that people aren't limiting themselves to "XML...must...have...DTD"
> 
> .duncan

Mime
View raw message