Hello Joose,

cocoon.request in javascript corresponds to the
org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon$FOM_Request class.
FOM_Request has the method

public Object get(String name) {
    return request.get(name);
}
where "request" is of the type
"org.apache.cocoon.environment.Request".
So the following should work
Packages.my.own.javaObject.getParams (cocoon.request);

Another way is to process request in javascript: it is also
programming language :)

JV> Hi again,

JV> I have a java object which wants to know 5 value sent by browser.

JV> In flow script I can call
JV> cocoon.request.get("param1");
JV> cocoon.request.get("param1");
JV> ...
JV> cocoon.request.get("param5");

JV> But because that is not always the case and only java object knows how 
JV> many of those are required..

JV> So

JV> is it possible to pass that cocoon.request object to java object, so in 
JV> that java-object I could do like

JV> class javaObject {
JV>   String param1;
JV>   String param2;
JV>   String param3;
JV>   String param4;
JV>   String param5;

JV>   void getParams (object cocoonRequest) {
JV>    param1 = cocoonRequest.get ("param1");
JV>    param2 = cocoonRequest.get ("param2");
JV>    param3 = cocoonRequest.get ("param3");
JV>    param4 = cocoonRequest.get ("param4");
JV>    param5 = cocoonRequest.get ("param5");
JV>   }
JV> }

JV> so in flowscript I could just call

JV> my.own.javaObject.getParams (cocoon.request);

JV> Then when new javaObject's are created, I just make that class 
JV> accessible for javascript and it works, no need to change flowscript 
JV> itself. And If I save object-data in a LList, I can do walk through on 
JV> those components and ask the to get those params...

JV> - Joose

JV> --
JV> "Always remember that you are unique, just like everyone else!"
JV> * http://iki.fi/joose/ * [EMAIL PROTECTED] * +358 44 561 0270 *


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

-- 
Best regards,
Peter Velychko                            
[EMAIL PROTECTED]


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

Reply via email to