cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: quick question on logging and actions
Date Mon, 12 Mar 2001 21:58:15 GMT
Donald Ball wrote:
> 
> On Mon, 12 Mar 2001, Berin Loritsch wrote:
> 
> > Examine any of the number of concrete actions available.  Once you write one
> > or two, it becomes easier and easier.
> 
> that's what i'm trying for. hmm, still having trouble actually getting the
> action invoked. here's what's in my sitemap:
> 
>   <map:actions>
>    <map:action name="add-employee"
> src="org.apache.cocoon.acting.DatabaseAddAction"/>
>    <map:action name="del-employee"
> src="org.apache.cocoon.acting.DatabaseDeleteAction"/>
>    <map:action name="upd-employee"
> src="org.apache.cocoon.acting.DatabaseUpdateAction"/>
>    <map:action name="send-mail"
> src="org.apache.cocoon.acting.SendmailAction"/>
>   </map:actions>
> 
>   ...
> 
>    <map:match pattern="forms/mail">
>      <map:act action="send-mail">
>        <parameter name="smtphost" value="mail.webslingerZ.com"/>
>        <map:generate src="docs/samples/forms/mail.xhtml"/>
>        <map:serialize/>
>      </map:act>
>    </map:match>
> 
> i'm logging extensively throughout my action, but i don't see anything in
> the cocoon.log file (which i didn't know about, thanks for the tip!) the
> mail.xhtml file is just a simple mail form that posts its results to its
> source URL. i get the form again in my browser, but no mail action has
> been fired off. any clues?

My assumption is that the <map:generate/> section is serializing your form?

If your action is to be the handler for a form, then you must place it in
a URL where the ACTION of your form is pointing.

For example:

<form name="fu" action="handle-fu">
  <input type="submit"/>
</form>

You will have two entries in the Sitemap (although if your desire is to
go directly to the same form you can collapse it into one):

<map:match pattern="handle-fu">
  <map:act action="send-mail">
    <parameter name="smtphost" value="mail.webslingerZ.com"/>
  </map:act>
  <map:redirect-to uri="fu"/>
</map:match>

<map:match pattern="fu">
  <map:generate src="docs/samples/forms/mail.xhtml"/>
  <map:serialize/>
</map:match>

Also note that if the Action does not return a Map object, then no
sitemap events contained inside will execute.  In that case, you
either have to return an empty map, or place those events outside
the <map:act/> event.

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message