cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Stevens <>
Subject Re: Cocoon in Eclipse??
Date Mon, 09 Jun 2008 06:23:19 GMT
migselv46 wrote:
> Hi
> I have searched everywhere and tried everything trying to use cocoon in
> Eclipse/Tomcat (or even better in WSAD 5.x) - that is - not by using ant,
> maven or jetty server.
> Is it at all possible?

What version - 2.1.x or 2.2?  With 2.1.x, the Ant build can generate a 
simple web app for you.  I just copied everything from that into the 
source folders of my own web app project, and started editing...

> If yes - how does it work? A normal web application described by 'web.xml'
> does not know anything about sitemaps, pipelines or the like.

No, but it "knows" about the Cocoon servlet.  Just include the 
appropriate entries for servlet (including init params) & 
servlet-mapping.  Then amend the various Cocoon config files as 
required.  No doubt there's a preferences setting somewhere in 
WSAD/eclipse to get it to recognise .xmap, .xconf, etc. as XML files 
rather than plain text.

Speaking of WSAD; if you're deploying to Websphere you may want to
- use PARENT_LAST classloader mode (at both application and web module 
levels) when you deploy your application, so that it uses the Xerces & 
Xalan versions shipped with Cocoon rather than Websphere's own. 
Alternatively, use the ParanoidCocoonServlet.
- in cocoon.xconf, change the jsp-engine implementation to use the 
"named servlet dispatcher" one (sorry, can't remember the exact 
classname, check the jsp block's jar) and configure it to use the "JSP 
1.2 Processor" (I think that's right, check the log messages as 
Websphere starts up to make sure).  If you use the default 
implementation, and have *.jsp mapped to Cocoon, you get an infinite 
loop as the RequestDispatcher Cocoon is given for any JSPs will call 
Cocoon itself again (which in all likelihood will map:match the same 
pipeline again).

> How do I connect cocoon and a "normal" servlet?

What do you mean by "connect"?  Cocoon *is* a normal servlet, albeit a 
rather complex one, so you can do the usual RequestDispatcher forwards & 
includes with it.  Only thing to watch out for is Cocoon always uses 
getOutputStream rather than getWriter, so jsp:include won't work; 
instead, use the JSTL's c:import tag which handles the writer/stream 
conversion.  Also, if you do want to use JSPs that forward/include to 
Cocoon (rather than have everything go through Cocoon and call the JSPs 
via the JSP generator/reader) make sure you don't map *.jsp to Cocoon in 
the servlet mappings.

--  Open source Sudoku solver

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message