You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jo...@chase.com on 2005/07/13 15:45:45 UTC

cocoon.request.getParameter null

If I have a page with the following line:

<a href="?id=7">7</a>

and I click on '7' it displays the following in the address bar:

http://my.page.com/function?id=7

I've got a flow script that matches 'function' and does the following:

<map:match pattern="function">
     <map:call function="do_call"/>
</map:match>

This is the function called:

if (cocoon.request.getParameter("id") != null) {
      do.something
}

Here's my problem, for some reason I cannot get cocoon to recognize
the request.  Basically, this 'if' statement is never true.

Does the request "function?id=7" still match "function" and the
continuation
would know to go back to "do_call"?

Also, how can I tell if what parameters are available to me?

Thanks.


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


Re: cocoon.request.getParameter null

Posted by Antonio Gallardo <ag...@agssa.net>.
Joshua.Schairbaum@chase.com wrote:

>If I have a page with the following line:
>
><a href="?id=7">7</a>
>
>and I click on '7' it displays the following in the address bar:
>
>http://my.page.com/function?id=7
>
>I've got a flow script that matches 'function' and does the following:
>
><map:match pattern="function">
>     <map:call function="do_call"/>
></map:match>
>
>This is the function called:
>
>if (cocoon.request.getParameter("id") != null) {
>      do.something
>}
>  
>
Have no time to check this now, but add before your statement:

cocoon.log.error("cocoon.request.getParameter('id') =" + 
cocoon.request.getParameter("id"))

This will show you on the console (if using jetty) the real parameter value.

Best Regards,

Antonio Gallardo

This is a basic javascript language construction: In javascript, you 
cannot test against "null" you need to test using "undefined"

>Here's my problem, for some reason I cannot get cocoon to recognize
>the request.  Basically, this 'if' statement is never true.
>
>Does the request "function?id=7" still match "function" and the
>continuation
>would know to go back to "do_call"?
>
>Also, how can I tell if what parameters are available to me?
>
>Thanks.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>  
>


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