You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Enrico Migliore <en...@fatti.com> on 2004/05/15 10:03:42 UTC

How to access the URI of a request from Flow/Javascript?

hi guys,


problem
--------
 I need to access the URI of a request from within Flow/Javascript.

                                      ---oOo---

situation
--------
I just realized that a function like:
                         cocoon.request.getRequestURI( )
does not exist.

                                      ---oOo---
question
--------
How can I access the URI of a request from within Flow/Javascript?


thanks,
 Enrico

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


added: cocoon.request.getRequestURI()

Posted by Enrico Migliore <en...@fatti.com>.
Hi guys,


fact
-------
 I added the following function to Cocoon:
                       "cocoon.request.getRequestURI( )"
in order to access the URI of the request from the Flow

                                 ---oOo---

how-to
-------
1. open "FOM_Cocoon.java" source file
2. Find the following class:
        public static class FOM_Request extends ScriptableObject {
         ......  
        }
3. add the following method to that class:
         public String jsFunction_getRequestURI( ) {
            return request.getRequestURI( );
        }
4. rebuild Cocoon

                                 ---oOo---

test
----
just add:  "System.out.println("URI = " + cocoon.request.getRequestURI( ));"
to your Flow/Javascript code and you'll see on the standard output the 
URI of
the client's request


many other functions can be added in this way.
 Enrico

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