Hi all,

The instructions assume you have an application called myapp:

1) Copy cocoon.jar and fop.jar into your orion/lib directory

2) Create a cocoon directory under myapp-web and put the cocoon.properties
file
into it

3) Add the following lines to web.xml in myapp-web/WEB-INF:
        <servlet>
                <servlet-name>Cocoon</servlet-name>
                <display-name>Cocoon</display-name>
                <servlet-class>org.apache.cocoon.Cocoon</servlet-class>
                <init-param>
                        <param-name>properties</param-name>
                        <param-value>/cocoon/cocoon.properties</param-value>
                </init-param>
        </servlet>
        <servlet-mapping>
                <servlet-name>Cocoon</servlet-name>
                <url-pattern>*.xml</url-pattern>
        </servlet-mapping>

4) Compile the following servlet in your orion/lib directory (to enable
XSP):

package classpath;

import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class Classpath extends HttpServlet { 

  public void init(ServletConfig conf) throws ServletException {
        String path=System.getProperty("java.class.path");
        if (path.lastIndexOf("cocoon") == -1)
                {
                        String
instdir=path.substring(0,path.indexOf("orion.jar"));
                        System.setProperty("java.class.path",path       +
                        File.pathSeparator +
                        instdir +
                        "xerces.jar" +
                        File.pathSeparator +
                        instdir+
                        "lib/cocoon.jar");
                }
        }       
        public void service (HttpServletRequest req, HttpServletResponse
res)
        throws ServletException, IOException
        {}
}

5)Comment out  from global-web-application.xml the lines referred to
com.evermind.servlet.XSLServlet and xsl in general

6)Add these lines to global-web-application.xml:

                <servlet>
                        <servlet-name>classpath</servlet-name>
                        <servlet-class>classpath.Classpath</servlet-class>
                        <init-param>
                                <param-name>defaultContentType</param-name>
                                <param-value>text/html</param-value>
                        </init-param>
                <load-on-startup>1</load-on-startup>
                </servlet>

7) copy the Cocoon samples dir under myapp-web

8) Restart Orion and try http://myhost/myapp/samples/index.xml :

All samples should work except First XSP Page(namespace library version)

All improvements  are welcome.

Luciano

Reply via email to