cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Stevens" <insomniacpeng...@googlemail.com>
Subject Re: Display tag library with cocoon 2.1
Date Tue, 06 Jan 2009 19:13:18 GMT
2009/1/4 Biondo Francesco Paolo <paolofrancesco.biondo@pro-netics.com>:
> Hi, thanks for the answer.
> I'm a newbie of cocoon, I want to use this tag library with cocoon, using
> CForms with definition and template file, like a JSP page.
> With JSP, I define the taglib using
> <%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
>
> How can I get the same result with Cocoon?

Well, the problem as I see it is that you want to use a CForms
definition & template "like a JSP".  Except it isn't a JSP, so a JSP
tag library isn't going to be much use to you in this context as it's
too dependent on the JSP page lifecycle and process flow. You might as
well ask "how can I use this tag library in a Perl script?"...

About the only way it might work would be to create some sort of "JSP
tag" Cocoon transformer, that can instantiate an instance of the (or
any?) tag class, simulate enough of the JSP PageContext to allow the
tag to execute, then call its doStartTag/doEndTag/etc. methods when
the triggering open & close elements are observed in the SAX event
stream (and buffering anything in between as necessary if it's a
BodyTag).  But that's not something I'd recommend unless you know
exactly what you're doing...

In my opinion you'd be better off figuring out some other way to
achieve similar effects with tables in Cocoon rather than trying to
get this taglib working in an environment it's not designed for.
http://displaytag.sourceforge.net/1.2/index.html mentions "sorting,
paging, cropping, grouping, exporting, ..."  I've not done much with
CForms myself so I don't know if it's got other ways to do these, but
many of them could be done in an XSL transformation, or through
client-side javascript; the paging could be done through a
FilterTransformer; the exporting could be done through a separate
pipeline based on the same data source but with a different
transformation and a FOP or HSSF serialiser...

Hope this helps,


Andy
-- 
http://pseudoq.sourceforge.net/

> Excuse my bad english :)
>
> Bye
> On Sun, 4 Jan 2009 15:33:14 +0000, "Andy Stevens"
> <insomniacpenguin@googlemail.com> wrote:
>> 2009/1/4 Biondo Francesco Paolo <paolofrancesco.biondo@pro-netics.com>:
>>> Hello, can I use displaytag (
>>> http://displaytag.sourceforge.net/1.2/install.html ) with Apache Cocoon?
>>> The Install's tutorial says to define: <%@ taglib
>>> uri="http://displaytag.sf.net" prefix="display" %>, using jsp, How can I
>>> define the tag extension in xml files in Cocoon? thanks
>>
>> What exactly are you trying to do?  Write the output of a Cocoon
>> pipeline into request/session attributes then forward the request to a
>> JSP that contains these tags?  Have a Cocoon pipeline dynamically
>> generate a JSP that contains these tags, which is subsequently run by
>> the container's JSP processor?  Use Cocoon's JSP generator to call a
>> JSP that uses these tags, then pass the resulting output through the
>> rest of a pipeline?  Or something else entirely?
>>
>> Since you talk about outputting a taglib directive, it sounds to me
>> like you're trying to dynamically generate a JSP using a Cocoon
>> pipeline.  Even if you could get it to work, this is probably a bad
>> idea - every matching request would run a pipeline, call the JSP
>> Compiler, run the resulting servlet, ...
>> Not particularly efficient, and depending on what app server you're
>> using it may be prone to memory or file handle leaks.  If you can give
>> us a better idea what you're trying to achieve we may be able to
>> suggest a better way to do it.  At the moment it just sounds to me
>> like you need to make your mind up which view technology you want to
>> use, Cocoon or JSPs.
>>
>>
>> Andy.
>> --
>> http://pseudoq.sourceforge.net/  Open source java sudoku application

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


Mime
View raw message