You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Geoff Howard <co...@leverageweb.com> on 2003/08/19 21:29:13 UTC
Classloading from flow (was [Fwd: RE: Calling Java classes from (JXForms)
javascript - can you? how?])
Here's a message from users where a guy figured out that his class had
to be under the current sitemap context directory to be found by flow.
- Is this a correct explanation of the current state?
- Is this the way it should work? Shouldn't classes/jars in WEB-INF be
found as well?
Geoff
-------- Original Message --------
Subject: RE: Calling Java classes from (JXForms) javascript - can you? how?
Date: Tue, 19 Aug 2003 13:41:58 -0400
From: Chris Clark <Ch...@teranet.ca>
Reply-To: users@cocoon.apache.org
To: <us...@cocoon.apache.org>
I figured it out! Just in case anyone else needs to know...
1) use Packages.dir.dir.class
e.g.
var MyClass = new Packages.com.domain.name.MyJavaClass();
2) The directories messed me up a bit. For Java actions, the class
files default to WEB-INF/classes. In order to get the javascript to
run, I had to put the package directory under my sitemap directory.
e.g.
Sitemap in:
c:\cocoon-2.1m2\build\webapp\myweb
Class files in:
c:\cocoon-2.1m2\build\webapp\mywebb\com\domain\name
Took a bit to figure it out, but it's working now. :)
> -----Original Message-----
> From: Chris Clark
> Sent: Tuesday, August 19, 2003 8:42 AM
> To: users@cocoon.apache.org
> Subject: Calling Java classes from (JXForms) javascript - can you? how?
>
> I'm using javascript with the JXForms and I'd like to call a Java function from within the flowscript.
> Something like:
>
> sendView(url1)
> sendView(url2)
> if (something updated in the model)
> call a member function from a Java class
>
> Is this possible? If so, how do you do it?
>
> Looking at the samples it appears as if the Form class is being used within the jxform.js so I think you can do, but my javascript skills aren't at the point where I can figure out how.
>
> Any tips, links to references, etc. would be really appreciated.
>
> Thanks,
> Chris
>
> ---------------------------------------------------------------------
> 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
Re: Classloading from flow (was [Fwd: RE: Calling Java classes from
(JXForms) javascript - can you? how?])
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
There's absolutely no reason that could lead classes to be loaded from
the sitemap directory: Cocoon does not define any classloader, except
the XSP classloader (which doesn't use the sitemap directory).
So classloading is performed by the servlet engine, meaning jar files in
WEB-INF/lib and classes in WEB-INF/classes.
So point 1/ about Packages.dir.dir.class is valid, but point 2/ is not.
Sylvain
Geoff Howard wrote:
> Here's a message from users where a guy figured out that his class had
> to be under the current sitemap context directory to be found by flow.
>
> - Is this a correct explanation of the current state?
> - Is this the way it should work? Shouldn't classes/jars in WEB-INF
> be found as well?
>
> Geoff
>
> -------- Original Message --------
> Subject: RE: Calling Java classes from (JXForms) javascript - can you?
> how?
> Date: Tue, 19 Aug 2003 13:41:58 -0400
> From: Chris Clark <Ch...@teranet.ca>
> Reply-To: users@cocoon.apache.org
> To: <us...@cocoon.apache.org>
>
> I figured it out! Just in case anyone else needs to know...
>
> 1) use Packages.dir.dir.class
> e.g.
>
> var MyClass = new Packages.com.domain.name.MyJavaClass();
>
> 2) The directories messed me up a bit. For Java actions, the class
> files default to WEB-INF/classes. In order to get the javascript to
> run, I had to put the package directory under my sitemap directory.
>
> e.g.
> Sitemap in:
> c:\cocoon-2.1m2\build\webapp\myweb
>
> Class files in:
> c:\cocoon-2.1m2\build\webapp\mywebb\com\domain\name
>
> Took a bit to figure it out, but it's working now. :)
>
>
>> -----Original Message-----
>> From: Chris Clark Sent: Tuesday, August 19, 2003 8:42 AM
>> To: users@cocoon.apache.org
>> Subject: Calling Java classes from (JXForms) javascript - can you?
>> how?
>>
>> I'm using javascript with the JXForms and I'd like to call a Java
>> function from within the flowscript.
>> Something like:
>>
>> sendView(url1)
>> sendView(url2)
>> if (something updated in the model)
>> call a member function from a Java class
>>
>> Is this possible? If so, how do you do it?
>>
>> Looking at the samples it appears as if the Form class is being used
>> within the jxform.js so I think you can do, but my javascript skills
>> aren't at the point where I can figure out how.
>>
>> Any tips, links to references, etc. would be really appreciated.
>>
>> Thanks,
>> Chris
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
>
>
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Classloading from flow (was [Fwd: RE: Calling Java classes from
(JXForms) javascript - can you? how?])
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
There's absolutely no reason that could lead classes to be loaded from
the sitemap directory: Cocoon does not define any classloader, except
the XSP classloader (which doesn't use the sitemap directory).
So classloading is performed by the servlet engine, meaning jar files in
WEB-INF/lib and classes in WEB-INF/classes.
So point 1/ about Packages.dir.dir.class is valid, but point 2/ is not.
Sylvain
Geoff Howard wrote:
> Here's a message from users where a guy figured out that his class had
> to be under the current sitemap context directory to be found by flow.
>
> - Is this a correct explanation of the current state?
> - Is this the way it should work? Shouldn't classes/jars in WEB-INF
> be found as well?
>
> Geoff
>
> -------- Original Message --------
> Subject: RE: Calling Java classes from (JXForms) javascript - can you?
> how?
> Date: Tue, 19 Aug 2003 13:41:58 -0400
> From: Chris Clark <Ch...@teranet.ca>
> Reply-To: users@cocoon.apache.org
> To: <us...@cocoon.apache.org>
>
> I figured it out! Just in case anyone else needs to know...
>
> 1) use Packages.dir.dir.class
> e.g.
>
> var MyClass = new Packages.com.domain.name.MyJavaClass();
>
> 2) The directories messed me up a bit. For Java actions, the class
> files default to WEB-INF/classes. In order to get the javascript to
> run, I had to put the package directory under my sitemap directory.
>
> e.g.
> Sitemap in:
> c:\cocoon-2.1m2\build\webapp\myweb
>
> Class files in:
> c:\cocoon-2.1m2\build\webapp\mywebb\com\domain\name
>
> Took a bit to figure it out, but it's working now. :)
>
>
>> -----Original Message-----
>> From: Chris Clark Sent: Tuesday, August 19, 2003 8:42 AM
>> To: users@cocoon.apache.org
>> Subject: Calling Java classes from (JXForms) javascript - can you?
>> how?
>>
>> I'm using javascript with the JXForms and I'd like to call a Java
>> function from within the flowscript.
>> Something like:
>>
>> sendView(url1)
>> sendView(url2)
>> if (something updated in the model)
>> call a member function from a Java class
>>
>> Is this possible? If so, how do you do it?
>>
>> Looking at the samples it appears as if the Form class is being used
>> within the jxform.js so I think you can do, but my javascript skills
>> aren't at the point where I can figure out how.
>>
>> Any tips, links to references, etc. would be really appreciated.
>>
>> Thanks,
>> Chris
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
>
>
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
RE: Classloading from flow (was [Fwd: RE: Calling Java classes from (JXForms) javascript - can you? how?])
Posted by Reinhard Pötz <re...@gmx.net>.
> -----Original Message-----
> From: Geoff Howard [mailto:cocoon@leverageweb.com]
> Sent: Tuesday, August 19, 2003 9:29 PM
> To: dev@cocoon.apache.org
> Subject: Classloading from flow (was [Fwd: RE: Calling Java
> classes from (JXForms) javascript - can you? how?])
>
>
> Here's a message from users where a guy figured out that his
> class had
> to be under the current sitemap context directory to be found by flow.
>
> - Is this a correct explanation of the current state?
> - Is this the way it should work? Shouldn't classes/jars in
> WEB-INF be
> found as well?
For me everythink works well. Classes in WEB-INF/classes are found.
Cheers,
Reinhard
>
> Geoff
>
> -------- Original Message --------
> Subject: RE: Calling Java classes from (JXForms) javascript -
> can you? how?
> Date: Tue, 19 Aug 2003 13:41:58 -0400
> From: Chris Clark <Ch...@teranet.ca>
> Reply-To: users@cocoon.apache.org
> To: <us...@cocoon.apache.org>
>
> I figured it out! Just in case anyone else needs to know...
>
> 1) use Packages.dir.dir.class
> e.g.
>
> var MyClass = new Packages.com.domain.name.MyJavaClass();
>
> 2) The directories messed me up a bit. For Java actions, the class
> files default to WEB-INF/classes. In order to get the javascript to
> run, I had to put the package directory under my sitemap directory.
>
> e.g.
> Sitemap in:
> c:\cocoon-2.1m2\build\webapp\myweb
>
> Class files in: c:\cocoon-2.1m2\build\webapp\mywebb\com\domain\name
>
> Took a bit to figure it out, but it's working now. :)
>
>
> > -----Original Message-----
> > From: Chris Clark
> > Sent: Tuesday, August 19, 2003 8:42 AM
> > To: users@cocoon.apache.org
> > Subject: Calling Java classes from (JXForms) javascript
> - can you? how?
> >
> > I'm using javascript with the JXForms and I'd like to call a Java
> > function from within the flowscript. Something like:
> >
> > sendView(url1)
> > sendView(url2)
> > if (something updated in the model)
> > call a member function from a Java class
> >
> > Is this possible? If so, how do you do it?
> >
> > Looking at the samples it appears as if the Form class is
> being used
> > within the jxform.js so I think you can do, but my
> javascript skills
> > aren't at the point where I can figure out how.
> >
> > Any tips, links to references, etc. would be really appreciated.
> >
> > Thanks,
> > Chris
> >
> >
> ---------------------------------------------------------------------
> > 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
>
>
>
>
>