> From: Dag Nygaard [mailto:[EMAIL PROTECTED]] > > There are a lot of questions raised around Cocoon and Struts, > but few (if any) answers of how to combine the two - > FAQ-food?. I am now in the process of attempting the > combination and not being very knowledgeable in either > Cocoon, Struts, JSP, I feel at times pretty lost. Could > someone help me out?
Let's try. (Selfreminder: create Cocoon-Struts comparison samples/articles/FAQs) > > The setup is as follows on a Win2K platform: > I have deployed Cocoon 2.0.3 in tomcat 4.0.4 environment, > i.e. placed the cocoon.war file in the > $CATALINA_HOME/webapps/ directory. The "welcome-page", > http://localhost:8080/cocoon, confirms that Cocoon and Tomcat > function OK together. Good. > > A Cocoon-testapplication resides on > $CATALINA_HOME/webapps/cocoon/myapp/, xml- and xsp-docs in > subdirectory resources/ and stylesheets (xsl) in subdirectory > styles/. A Hello_user.xml with matching hello_user.xsl > pipeline functions OK. > > To test a similar Struts setup, we have created a new > application subdirectory myjspapp, under cocoon/ in which > Struts' WEB-INF/-directory reside with: Do you mean that you have this structure: webapps/cocoon/myjspapp/WEB-INF? If yes, then it's definitely incorrect if you didn't alter the server.xml (in Tomcat/conf) to that subdirectory as an application context (which can be not allowed, anyway). > - compiled classes in subdirectories/files - for both Actions > and Forms > - modified files struts-config.xml and other > struts-*.tld-files, web.xml-file > - lib/-directory with castor-0.9.3.21.jar, > castor-0.9.3.21-xml.jar and struts.jar. Note: I have also > copied these jar-files to cocoon/WEB-INF/lib/ > - src/-directory. You should use the same WEB-INF directory both for Cocoon and Struts and also take a look at the web.xml and make sure that you have desired servlet mappings. Struts by default is mapped to *.do and Cocoon is mapped to /* and *.jsp. Remove mapping to JSP from Cocoon and try again. Note, that if you call JSP directly then it won't be processed by Struts, only *.do (or whatever you configure in web.xml) URLs are went through Struts. > > A Hello_user.jsp-file (with a Hello_user.html-file) reside in > the root of myjspapp uses the abovementioned > hello_user.xsl-file. The pipeline I attempt to use looks like this: > > <map:pipeline> > <map:match pattern="hellojsp"> > <map:generate src="myjspapp/hello_user.jsp" type="jsp"/> > <map:transform src="myapp/styles/hello_user.xsl"/> > <map:serialize type="html"/> > </map:match> > > This setup fails. The errormessage I get is: > "org.apache.cocoon.ProcessingException: ServletException in > JspGenerator.generate(): javax.servlet.jsp.JspException: > Cannot find ActionMappings or ActionFormBeans collection" > > My guess is that the Struts-parts require access/setup of the > struts-config.xml-file, but how do I do that? Is there > something I should setup in Cocoon's cocoon.xconf-file or > Cocoon's web.xml-file? It's configured in the web application deployment descriptor: WEB-INF/web.xml as ActionServlet init params. Hope this helps a little. Konstantin > > -- > Dag Nygaard > [EMAIL PROTECTED] > > --------------------------------------------------------------------- > 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: <[EMAIL PROTECTED]> > For additional commands, e-mail: <[EMAIL PROTECTED]> > --------------------------------------------------------------------- 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: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>