java - how pass an objet in parameter of another class in LS2J? -
java - how pass an objet in parameter of another class in LS2J? -
i trying pass object of java class (a bean) class ls2j.
the problem error returned :
ls2j error: threw java.lang.classnotfoundexception: com.pasquier.dto.ws.logwsdto
i don't know why ?
i have class bean getter , setter. want pass instance of class in another.
my class in lotus ls2j :
class logwebservice sessionjava javasession classjava javaclass objectjava javaobject methodjava javamethod public sub new() set sessionjava = new javasession set classjava = sessionjava.getclass("com.pasquier.launcher/logwebservice") set objectjava = classjava.createobject end sub public sub setlog(logdto logwsdto) set methodjava = classjava.getmethod("setlog","(lcom/pasquier/dto/ws/logwsdto;)v") objectjava.setlog(logdto) end sub end class
it method setlog crashes
i phone call in code :
class loggetalldocumentsdao private ilog logwebservice private logdto logwsdto private docdto loggetalldocumentsdto public sub new(logwsparam logwsdto, docdtoparam loggetalldocumentsdto) set me.logdto = logwsparam set me.docdto = docdtoparam end sub public sub appellog() set ilog = new logwebservice() ' error: ls2j error: threw java.lang.classnotfoundexception: com.pasquier.dto.ws.logwsdto phone call ilog.setlog(logdto) end sub
an thought ?
i have class logdto in same library logwebservice.
class logwsdto sessionjava javasession classjava javaclass objectjava javaobject methodjava javamethod public sub new() set sessionjava = new javasession set classjava = sessionjava.getclass("com.pasquier.dto.ws/logwsdto") set objectjava = classjava.createobject end sub
if understand can't pass logdto :
set me.logdto = logwsparam
is ? how ??
well seek doesn't work.
i add together getobjet method in ls2j (not in java on lotus)
class logwsdto sessionjava javasession classjava javaclass objectjava javaobject methodjava javamethod public sub new() set sessionjava = new javasession set classjava = sessionjava.getclass("com.pasquier.dto.ws/logwsdto") set objectjava = classjava.createobject end sub public function getjavaobject() set getjavaobject = objectjava end function
i seek phone call in prog :
class loggetalldocumentsdao private ilog logwebservice private logdto logwsdto private docdto loggetalldocumentsdto public sub new(logwsparam logwsdto, docdtoparam loggetalldocumentsdto) set me.logdto = logwsparam set me.docdto = docdtoparam end sub public sub appellog() phone call ajouterparam() set ilog = new logwebservice() phone call ilog.setlog(logdto.getjavaobject()) end sub
i can't save alter : returns :
"type mismatch on : getjavaobject"
so seek add together method in logwebservice' s java class. , seek in ls2j :
public function getjavaobject() set methodjava = classjava.getmethod("getjavaobject","()lcom/pasquier/dto/ws/logwsdto;") getjavaobject = objectjava.getjavaobject() end function
i phone call :
public sub appellog() set ilog = new logwebservice() set logdto = logdto.getjavaobject phone call ilog.setlog(logdto)
and doesn't works, same message, cry !!!
objectjava.setlog(logdto)
- logdto has java object generated ls2j. won't work lotusscript class object.
add method getjavaobject() lotusscript class logwsdto returns ls2j java object objectjava
. utilize way then:
objectjava.setlog(logdto.getjavaobject())
this working example:
lotusscript agent:
class="lang-vb prettyprint-override">option declare uselsx "*javacon" utilize "aandb" class logwsdto sessionjava javasession classjava javaclass objectjava javaobject public sub new() set sessionjava = new javasession set classjava = sessionjava.getclass("de.leonso.test/b") set objectjava = classjava.createobject end sub public function getjavaobject() set getjavaobject = objectjava end function end class sub initialize dim sessionjava javasession dim classjavaa javaclass dim objectjavaa javaobject dim lsb logwsdto set sessionjava = new javasession set classjavaa = sessionjava.getclass("de.leonso.test/a") set objectjavaa = classjavaa.createobject set lsb = new logwsdto() print objectjavaa.a(lsb.getjavaobject()) end sub
java classes in java scriptlibrary "aandb":
class="lang-java prettyprint-override">package de.leonso.test; public class { public string a(b b) { homecoming b.b(); } } bundle de.leonso.test; public class b { public string b() { homecoming ("hallo"); } }
java lotus-domino ls2j
Comments
Post a Comment