Try remove CONFIG_ATTR parameter from web.xml and use CatalogFactory
to get the catalog.
Howard
On Thu, 17 Mar 2005 15:16:55 -0600, Mike Miller <[EMAIL PROTECTED]> wrote:
> Hi, I am just starting with the Commons Chain package and am trying to
> use the ChainListener to load my small test catalog. The listener fires
> but does not put anything in the catalog. I know if finds my resource
> file, but the catalog is empty coming out of ChainListener. Below is a
> copy of my catalog.xml and web.xml. Can someone please tell me what I
> am missing?
>
> Here's the snippet of code trying to execute the chain (alot this was
> copied from the Chains cookbook doc)
>
> ServletContext servletContext =
> request.getSession().getServletContext();
> Catalog catalog = (Catalog) servletContext.getAttribute("catalog");
> Command command = catalog.getCommand(name);
> boolean stop = command.execute(context);
>
> <?xml version="1.0" ?>
> <catalog name="catalog">
> <chains>
> <chain name="login">
> <command name="Authentication"
> className="util.servlet.command.AuthenticationCommand"/>
> <command name="ShowHome"
> className="util.servlet.command.ShowHomeCommand"/>
> <command name="Mike"
> className="util.servlet.command.MikeCommand"/>
> </chain>
> </chains>
> </catalog>
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <!DOCTYPE web-app
> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> "http://java.sun.com/dtd/web-app_2_3.dtd">
>
> <web-app>
>
> <display-name>TestServlet</display-name>
> <description>Testing</description>
>
> <!-- Commons Chain listener to load catalogs -->
> <context-param>
>
> <param-name>org.apache.commons.chain.CONFIG_CLASS_RESOURCE</param-name>
> <param-value>resources/catalog.xml</param-value>
> </context-param>
> <context-param>
> <param-name>org.apache.commons.chain.CONFIG_ATTR</param-name>
> <param-value>catalog</param-value>
> </context-param>
> <listener>
>
> <listener-class>org.apache.commons.chain.web.ChainListener</listener-cla
> ss>
> </listener>
>
> <servlet>
> <servlet-name>TestServlet</servlet-name>
> <servlet-class>util.servlet.TestServlet</servlet-class>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>TestServlet</servlet-name>
> <url-pattern>/test/*</url-pattern>
> </servlet-mapping>
>
> </web-app>
>
>
> Mike Miller
> JDA Software Group, Inc.
> 7501 Ester's Blvd, Suite 100
> Irving, Texas 75063
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]