cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten Schlabach" <tschlab...@apache.org>
Subject [Concrete Thought] How to modify web.xml from a block properly?
Date Mon, 28 Nov 2005 17:25:58 GMT
Hi!

I hope I haven't overlooked this in the archives. But the thread that
sounded promising at first
(http://www.mail-archive.com/dev@cocoon.apache.org/msg35223.html) had
little to do with the info I was looking for.

I am trying to pick up the CHS petstore example (Cocoon, Hibernate,
Spring) from http://www.cocoondev.org/main/117/43.html with the latest
release of Cocoon (2.1.8), but I am having a hard time getting this to
work.

Following the comments on that CHS example page it turns out that one of
the problems is that this block needs to add a couple of entries to the
web.xml file, such as a context-parameter, a listener, a filter and a
filter-mapping.

Jetty applies a strict DTD to web.xml, therefore the order of elements
matters. (Other than Tomcat by default, were you can mix them in whatever
order you want.)

There is a mechanism described in the comments that uses tags hidden in
XML comments in Cocoons web.xml file in src/webapp/WEB-INF/web.xml as a
sort of anchors to direct XPatch to put the additional elements in the
rights positions in the final web.xml file.

Pretty creative approach, and it works fine. The only problem being that
other blocks (faces!) that also add stuff to web.xml don't use that
mechanism but just use absolut positioning of their additions (i.e. "put
that listener right in front"), thus leaving no change to but for example
and context-parameter elements before that listener.

The problem can be circumvented by disabling the faces block in my case,
but it leaves me with the question: Is that mechanism of using comments to
insert fragments into the right position in web.xml sort of the official
Cocoon way. Or is there no official way because that problem never showed
up so far?

If it is the official way, should I file a bug for the faces block?

I guess it will become more of an issue sooner or later.

Any thoughts?

Is there any way to teach XPath the DTD so it would find out itself where
an element belongs, for example?

Regards,
Torsten


Mime
View raw message