You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Struts Two <st...@yahoo.ca> on 2009/07/14 21:03:19 UTC

Struts1.3.10 and command chains

Prior to struts 1.3, If I wanted to load my catalog (say catalog.xml) file (which had all the business logic in chains for my app), I had to add the followings to my web.xml:

<context-param>
   <description></description>
   <param-name>org.apache.commons.chain.CONFIG_CLASS_RESOURCE</param-name>
   <param-value>resources/catalog.xml</param-value>
</context-param>

<listener>
   <description>Chain Listener</description>
   <display-name>Chain Listener</display-name>
   <listener-class>org.apache.commons.chain.web.ChainListener</listener-class>
</listener>



In struts 1.3.10 request processing cycle is rewritten using command chains and the jar file is part of struts apps. I was wondering if I want to load my own catalog [in which I have the list of all chains that runs my business logic], do I have to add ChainListener and CONFIG_CLASS_RESOURCE context parameter to my web.xml to be able to load my chain or command as follows:

Catalog catalog = CatalogFactory.getInstance().getCatalog();
Command command = catalog.getCommand("runTivoliCPUAVG");


      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now
http://ca.toolbar.yahoo.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts1.3.10 and command chains

Posted by Paul Benedict <pb...@apache.org>.
Did you ever find out your answer?

On Tue, Jul 14, 2009 at 2:03 PM, Struts Two <st...@yahoo.ca> wrote:

>
> Prior to struts 1.3, If I wanted to load my catalog (say catalog.xml) file
> (which had all the business logic in chains for my app), I had to add the
> followings to my web.xml:
>
> <context-param>
>   <description></description>
>   <param-name>org.apache.commons.chain.CONFIG_CLASS_RESOURCE</param-name>
>   <param-value>resources/catalog.xml</param-value>
> </context-param>
>
> <listener>
>   <description>Chain Listener</description>
>   <display-name>Chain Listener</display-name>
>
> <listener-class>org.apache.commons.chain.web.ChainListener</listener-class>
> </listener>
>
>
>
> In struts 1.3.10 request processing cycle is rewritten using command chains
> and the jar file is part of struts apps. I was wondering if I want to load
> my own catalog [in which I have the list of all chains that runs my business
> logic], do I have to add ChainListener and CONFIG_CLASS_RESOURCE context
> parameter to my web.xml to be able to load my chain or command as follows:
>
> Catalog catalog = CatalogFactory.getInstance().getCatalog();
> Command command = catalog.getCommand("runTivoliCPUAVG");
>
>
>      __________________________________________________________________
> Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your
> favourite sites. Download it now
> http://ca.toolbar.yahoo.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>