cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Brisbin" <bris...@ipa.net>
Subject Using Struts/other servers for XML content
Date Wed, 02 May 2001 18:52:13 GMT

I've successfully tested my Struts/Cocoon setup and it works good, but
there's a few issues I thought I'd pass along to everyone in case others try
this too (or want to ;-)...

1)  I added the following into my sitemap.xmap, assuming that you've copied
the right Struts stuff into your WEB-INF/web.xml file to handle the *.do
stuff in Struts:
   <map:match pattern="struts/*">
    <map:generate src="http://localhost:8080/{1}.do"/>
    <map:transform src="stylesheets/test.xsl"/>
    <map:serialize type="xml"/>
   </map:match>

2)  For some reason others aren't sure yet, you have to use the servlet.jar
file that comes with Tomcat, and NOT the servlet_2_2.jar that's in C2.  JSP
pages with taglib directives won't work if you don't do this step.

3)  In your JSP pages that Struts uses, you have to add extra closing tags
on many of the Struts tags because they're assuming (a design flaw/IMHO)
that you want straight HTML and aren't going to be outputting valid XML.
Things like <html:base/> will need a closing </base>...in otherwords, you
have to do this:  <html:base/></base> because the html taglib in Struts
outputs an invalid XML tag, i.e. a base element with any empty body, but no
closing '/'.  Same goes for the input and struts-form stuff...

You could just as easily use pure JSP, etc...through the JSP generator, or
through a remote server or EJB client that spits out XML and is
unrelated/not possible to be put all under the C2 framework (i.e. you're
just using C2 for transformation and not the heavy back-end work).  I
personally like doing it this way because it splits things apart even more
and let's me use whatever I want to generate my XML, and still have the
publishing capability of C2...

I'm sure there's more, and I'll relay them as I get into it more heavily...

jb


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.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