cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Howard" <coc...@leverageweb.com>
Subject RE: Fantastic!!!! My first Generator that connects to an EJB.
Date Mon, 27 Jan 2003 15:48:32 GMT
> -----Original Message-----
> From: Bruno Dumon [mailto:bruno@outerthought.org]
> Sent: Monday, January 27, 2003 10:26 AM
> To: cocoon-users@xml.apache.org
> Subject: Re: Fantastic!!!! My first Generator that connects to an EJB.
>
>
> On Mon, 2003-01-27 at 13:58, Robert Simmons wrote:
> > This sucker connects to an EJB which runs the given JDO query and
> > returns the set of found objects from the database. Best of all it
> > works!!!! See the two attached files. Next thing you know I will be
> > writing something useful. O_O
> >
>
> Just some small hints...
>
> * I see you do the following in your code:
>
> this.contentHandler.processingInstruction("xml",
>                              "version=\"1.0\" encoding=\"UTF-8\"");

Yes, Robert I was just going to write this to you - no need to do this.
If you wind up needing to serialized this out as xml at the end of
a pipeline instead of html (debugging, webservices, etc) the proper
cocoon way is to specify the encoding as a child element of the serializer.

That said, the default set up for the xml serializer is UTF-8 and the
xml declaration is added automatically for you.  By the way, remember that
the same serializer class can be set up with different sitemap "name" hints
for convenience of different set ups.  If you wanted to have a different
encoding on some pipelines, you could define the xml serializer component
in <map:serializers> as name="xml-ISO" and use that as the <map:serialize
type="xml-ISO">

>
> * For logging, instead of using log4j, you can use Avalon's logger.
> Since the class extends from AbstractGenerator, it is already available:
> simply call getLogger().error("...")

I'll speak for him - he prefers log4j.

Geoff



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message