The HttpServletRequest should get passed in implicitly as long as you invoke
remoteTest as you've declared it. Is it not working for you? For example, in
examples/sessionwindow.lzx there's a setAttribute method that looks like:

        <remotecall name="setAttrRPC" funcname="setAttribute"
                    remotecontext="$once{canvas.session}">
            <param><method name="getValue">
                return classroot.name + '-pos';
            </method></param>
            <param><method name="getValue">
                return [ classroot.x, classroot.y ];
            </method></param>
        </remotecall>

and where the java code looks like:

    /** javascript objects are passed in as Hashtables. */
    public static void setAttribute(String name, Hashtable value,
                                    HttpServletRequest req) {
        _setAttribute(name, value, req);
    }

See WEB-INF/lps/server/src/org/openlaszlo/remote/LzHttpSessionRemote.java for
details.

pablo

On Thu, 15 Jun 2006, Not Zippy wrote:

> thanks for the reply.. I have no problem constructing the object (the
> security tags are defined), But I need to pass the HttpServletRequest
> in the method in the remote call.
>
> My java class is like
> public class RemoteTest {
> public void remoteTest(String criteria, HttpServletRequest request) {
> }
> }
>
> My remote call is
> <remotecall funcname="remoteTest">
> <param value="'test'"/>
> </remotecall>
>
> What I dont know is how to signal the javarpc's invoke method to pass
> the HttpServletRequest..
>
>
>
> On 6/14/06, Pablo Kang <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > Sorry for the late reply. Just got back from vacation.
> >
> > Did you declare a security tag with the class you want to use?
> >
> >   <security>
> >     <allow>
> >       <pattern>^com.mycompany.MyClass</pattern>
> >     </allow>
> >   </security>
> >
> > More info at:
> >
> >   http://www.laszlosystems.com/lps-3.2/docs/reference/security.html
> >   http://www.laszlosystems.com/lps-3.2/docs/reference/javarpc.html
> >   http://www.laszlosystems.com/lps-3.2/docs/guide/rpc-javarpc.html
> >
> > Hope this helps.
> >
> > pablo
> >
> > On Wed, 14 Jun 2006, Not Zippy wrote:
> >
> > > Hi
> > >
> > > I am still looking for an answer.
> > > For now I am simply hard coding the opts['doreq']=1 in the javarpc.js
> > > file (In method LzJavaRPC.prototype.invoke = function(delegate, args,
> > > opts, secure, secureport))
> > >
> > > ID REALLY appreciate any ideas on this
> > > Surely someone must know...
> > >
> > >
> > >
> > > On 6/13/06, Not Zippy <[EMAIL PROTECTED]> wrote:
> > > > hi
> > > >
> > > > I have an existing web application that maintains a database
> > > > connection pool in the servlet context. I'd like to retrieve a
> > > > connection and use it to fetch some data via a a javrpc call.
> > > >
> > > > Ive tried createing an instance of the object (using javarpc) and then
> > > > attempted to invoke a call passing the httprequest to the object
> > > > instance.
> > > > This fails with a "forbidden class : undefined" all the time. Is there
> > > > a better way of doing this ? Heres a snippet of code I tried,
> > > > basically after the object is loaded I call "LzJavaRPCService.invoke"
> > > > passing in the opts with a "doreq=1".
> > > >
> > > > According to javarpc.js (inside which is declared "var
> > > > LzJavaRPCService = new LzJavaRPC();")
> > > > The definition of the invoke method of class LzJavaRPC :
> > > > //     opts['doreq'] if value is 1, adds http request to remote method 
> > > > call.
> > > > //     opts['dores'] if value is 1, adds http response to remote method 
> > > > call,
> > > > ...
> > > > LzJavaRPC.prototype.invoke = function(delegate, args, opts, secure, 
> > > > secureport){
> > > >
> > > >
> > > >
> > > > <javarpc ....
> > > >         <handler name="onload">
> > > >             Debug.write("----------");
> > > >             Debug.write("constructed with", this.createargs);
> > > >             Debug.write(this.proxy);
> > > >             var opts = {
> > > >                 loadoption: this.loadoption,
> > > >                 params: {},
> > > >                 classname: this.classname,
> > > >                 oname: this.attributename,
> > > >                 scope: this.scope,
> > > >                 doreq:"1" ,
> > > >                 methodname:"testResponse"
> > > >             }
> > > >             Debug.write("Options")
> > > >             Debug.write(opts);
> > > >             LzJavaRPCService.invoke(this.myDel, opts, this.secure,
> > > > this.secureport);
> > > >
> > > >         </handler>
> > > >
> > > >     </javarpc>
> > > >
> > > > Any ideas on this would be greatly appreciated...
> > > >
> > > > Thanks
> > > > Z
> > > >
> > > _______________________________________________
> > > Laszlo-user mailing list
> > > [email protected]
> > > http://www.openlaszlo.org/mailman/listinfo/laszlo-user
> > >
> >
>
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to