tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koss, Loren" <LK...@massivemedia.com>
Subject RE: Please point me in the right direction..
Date Tue, 10 Oct 2000 21:23:05 GMT
Thanks for the help.. okay, as a test, i did the following:
created the following directories:

$TOMCAT_HOME/webapps/loren
$TOMCAT_HOME/webapps/loren/jsp
$TOMCAT_HOME/webapps/loren/WEB-INF/classes

then in the jsp directory, i made the following page (index.jsp):

<jsp:useBean id="cb" scope="session" class="Test" />
this is a test JSP page
<br><br>
<%=cb.getTestStr() %>

then in the classes directory is the following Test.java:
public class Test {

public String getTestStr() { return "This came from the servlet";}
}

when i try to bring up the jsp page, this is the error i get:
org.apache.jasper.JasperException: Unable to compile class for
JSP/usr/local/tomcat/work/localhost_8080%2Floren/_0002fjsp_0002findex_0002ej
spindex_jsp_0.java:60: Class jsp.Test not found.
                Test cb = null;
                ^
/usr/local/tomcat/work/localhost_8080%2Floren/_0002fjsp_0002findex_0002ejspi
ndex_jsp_0.java:63: Class jsp.Test not found.
                    cb= (Test)
                         ^
/usr/local/tomcat/work/localhost_8080%2Floren/_0002fjsp_0002findex_0002ejspi
ndex_jsp_0.java:68: Class jsp.Test not found.
                            cb = (Test) Beans.instantiate(getClassLoader(),
"Test");
                                  

Thanks for your help..

Loren


-----Original Message-----
From: Kitching Simon [mailto:Simon.Kitching@orange.ch]
Sent: Tuesday, October 10, 2000 12:24 PM
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: Please point me in the right direction..


Hi,

Tomcat complies with the servlet specification from Sun.
You can download this document from the sun website.

A webapp needs to have exactly the directory structure
defined in the specification. However, this is not very complicated.

(a) create a directory under $TOMCAT_HOME/webapps
  [yes, you can put it elsewhere, but as you're just starting it
   is best to go with the default structure for the moment]
(b) create a WEB-INF directory under that
(c) create classes and lib directories under WEB-INF.

Or you could copy the directory structure from the examples...

You're now done. Actually, if you don't have any java beans
or servlets (which go in that WEB-INF/classes directory)
then you probably don't need to even create the WEB-INF
directory. Still, it's better to have it for later.

Of course, you will probably need more guff than that 
as your project gets more complicated. For
example, you probably will want to create a "web.xml" file 
and put it in the WEB-INF directory.

Build.xml files are to do with a make-like tool called "ant",
which is the default way of recompiling the tomcat source code.
As long as you are downloading binaries of tomcat, you don't
need to know about ant (though you might want to use it in
your own code if you don't use an IDE; it's better than 
makefiles for compiling java source). Ant can be downloaded
from the apache website if you want it.

Cheers,

Simon

> -----Original Message-----
> From:	Koss, Loren [SMTP:LKoss@massivemedia.com]
> Sent:	Tuesday, October 10, 2000 8:52 PM
> To:	'tomcat-user@jakarta.apache.org'
> Subject:	Please point me in the right direction..
> 
> I've read the documentation on the jakarta.apache.org page and have looked
> at the servlet API and JSP stuff, but I am still a little weary on exactly
> how to START an application..  I've used Enhydra before and it had a real
> nice app that created your directory structure and framework for you..  It
> looks like that doesn't exist here.  So.. I think I understand what to
> do..
> But, looking at the examples, I don't see exactly what it seems to say in
> the docs..  Like for example, I thought you needed a build.xml for each
> application..  That doesn't appear to be the case..  Can someone point me
> in
> the right direction?
> 
> Thanks
> 
> Loren Koss
> Senior Software Engineer
> Massive Media Group
> 310 586-3409

Mime
View raw message