struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emanuele <manun...@yahoo.it>
Subject problems retriving a Catalog from a Struts Action: ChainListener get a catalog null
Date Fri, 29 Dec 2006 11:12:01 GMT
Hi, I'm trying to get a Catalog from a Struts Action using ChainListener as described  in the
Commons Chain Cookbook at point "call a Command from Struts". 

What happens is that I get a Null Catalog executing this line of code:
Struts Action:

... ...
Catalog catalog = (Catalog) request.getSession().getServletContext().getAttribute("catalog");
... ...

This is my relevant config:

web.xml:
<!-- Commons Chain listener to load catalogs  -->
<context-param>
  <param-name>org.apache.commons.chain.CONFIG_WEB_RESOURCE</param-name>
      <param-value>/WEB-INF/catalog.xml</param-value>
</context-param>
<listener>
  <listener-class>org.apache.commons.chain.web.ChainListener</listener-class>
</listener>

Struts-config:

<action path="/testComando"  
            name="testBean" scope="request" validate="false"
            type="it.prato.comune.sit.serviziweb.controller.action.CommandAction">
    <forward  name="success"    path="/jsp/home.jsp" />
</action>

catalog.xml:
<catalog name="catalog">
    <command name="Comando2"           className="it.prato.comune.sit.serviziweb.controller.command.TestCmdDue"
/>
</catalog>

I just to be able to read my catalog from a Struts Action to get the commands executed. Any
kind of suggest would be appreciate. Thanks.
 __________________________________________________
Do You Yahoo!?
Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito
per i tuoi file e i messaggi 
http://mail.yahoo.it 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message