> From: Andre Thenot [mailto:[EMAIL PROTECTED]]
> 
> Hi,
> 
> I've looked in the docs and in the archives but I can't find out
> why I'm having trouble with actions in Cocoon 2.0 (binary
> version). Here's what I did:
> 
> 1. I created a HelloPoohAction.java, almost identical to the one
> in the "Creating and using actions" docs, except that I added
> import statements for Redirector and SourceResolver, and the
> act() method contains:
> 
>    Map sitemapParams = new HashMap();
>    sitemapParams.put("mySiteParamValue", "Eeyore");
>    Request request = (Request)
objectModel.get(Constants.REQUEST_OBJECT);
>    request.setAttribute("myname", "Tigger");
>    return sitemapParams;
> 
> 2. I compiled this file and placed the class file into a
> sub-directory of WEB-INF/classes (to match the package).
> 
> 3. I stopped Tomcat (4.0.1), and removed Cocoon's work directory
> (just in case anything was cached).
> 
> 4. At the top of my sitemap, I have in the <map:actions> section:
> 
>     <map:action name="hello-pooh"
> src="com.newhomesdirect.web.HelloPoohAction"/>
> 
> and my <match> section looks like this:
> 

Make a change:

>     <map:match pattern="xsp/*">
>      <map:act type="hello-pooh">
>       <map:generate type="serverpages"
src="docs/samples/xsp/{../1}.xsp"/>
>       <map:transform src="stylesheets/dynamic-page2html.xsl">
>        <map:parameter name="view-source"
> value="docs/samples/xsp/{../1}.xsp"/>
>       </map:transform>
>      </map:act>
>      <map:serialize/>
>     </map:match>

Note that {1} replaced with {../1}.
It's like a path. Actions/matchers are like nodes.

Vadim



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to