You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Johannes Wechsler <jo...@mchp.siemens.de> on 2002/08/30 15:14:25 UTC

Import packages and classes

Hi,
I intend to include a class file into a xsp.

My Code (cutting):

<xsp:structure>
   <xsp:include>MyClass</xsp:include>
 </xsp:structure>

<xsp:logic>
  MyClass example = new MyClass();
</xsp:logic>

Following error message appears:
class MyClass not found in class org.apache.cocoon.www.dev.hello_xsp

My questions:
- Do I have to store the MyClass.class file in a special folder (like
WEB-INF\classes)? In which one?
- What do I have to do that Tomcat/Cocoon recognises my class file?
   (Adding the directory where the file is stored to the Classpath didn't
result in any success)
- The same problem occurs with packages. What points do I have to attend
here?

Regards,
Johannes

----------------------------------
Operating system: Windows 2000
Tomcat: 4.0.4
JDK: 1.4.0
Cocoon: 2.0.3


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Import packages and classes

Posted by Koen Pellegrims <ko...@pandora.be>.
Johannes,

Maybe you should brush up on your common Java and Application-server
technologies; this is very common practice.

You should put:
1. your jar-file in WEB-INF/lib
OR
2. your class file in WEB-INF/classes/<package>/MyClass.class

eg if your class is in the package com.soft.mine, the class-file should be
in WEB-INF/classes/com/soft/mine/

(haven't I answered exactly the same question a few days ago...?)

Koen

> -----Oorspronkelijk bericht-----
> Van: Johannes Wechsler
> [mailto:johannes.wechsler.external@mchp.siemens.de]
> Verzonden: vrijdag 30 augustus 2002 15:14
> Aan: cocoon-users@xml.apache.org
> Onderwerp: Import packages and classes
>
>
> Hi,
> I intend to include a class file into a xsp.
>
> My Code (cutting):
>
> <xsp:structure>
>    <xsp:include>MyClass</xsp:include>
>  </xsp:structure>
>
> <xsp:logic>
>   MyClass example = new MyClass();
> </xsp:logic>
>
> Following error message appears:
> class MyClass not found in class org.apache.cocoon.www.dev.hello_xsp
>
> My questions:
> - Do I have to store the MyClass.class file in a special folder (like
> WEB-INF\classes)? In which one?
> - What do I have to do that Tomcat/Cocoon recognises my class file?
>    (Adding the directory where the file is stored to the Classpath didn't
> result in any success)
> - The same problem occurs with packages. What points do I have to attend
> here?
>
> Regards,
> Johannes
>
> ----------------------------------
> Operating system: Windows 2000
> Tomcat: 4.0.4
> JDK: 1.4.0
> Cocoon: 2.0.3
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>