You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ru...@libero.it on 2001/11/08 11:33:43 UTC

problems with jsp and beans

Hello everybody!
I'm a new TOmcat 4.0 user.
I installed it on a Win NT 4.0 pc. The server starts and processes 
simple jsp pages (without <jsp:useBean...> or similar instructions).
I need to use a bean. It's a java file named MysqlDb, it handles the 
connection to a Mysql Database and do other useful stuff.I compiled it 
and copied the .class file in the WEB-INF/classes directory of my web 
application (it's named 'reti' and it's in $CATALINA_HOME\webapps 
directory. My $CATALINA_HOME is 'c:\damiani-reti\jakarta-tomcat-
4.0.1'). The application is a simple Form that sends data to the jsp 
file. In it I call the bean:
<jsp:useBean id="dbh" scope="application" class="my.MysqlDb" />

but the server gives me the error:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 15 in the jsp file: /query.jsp

Generated servlet error:
C:\damiani-reti\jakarta-tomcat-4.0.1
\work\localhost\reti\query$jsp.java:77: Class org.apache.jsp.MysqlDb 
not found.
                MysqlDb dbh = null;
and so on...                

The web.xml file is the one given in the documentation. I don't use any 
servlet so it's very simple.
I tried to find a solution reading pieces of the servlet-2.3 
specification and the jsp-1.1 specification, the docs included with 
tomcat... but I didn't find any solution...
hope someone can help me :-)

Thank u!
see ya!

Ruggero.


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: problems with jsp and beans

Posted by Surya Saraff <su...@yahoo.com>.
Hi,

When you make you MysqlDb.java, it should be in a
directory named "my" and name of the package should
also be "my". It has to be in a package. Make sure
that this directory "my" is in the same place where
the examples are.  if there is any problem, then email
me at saraffsp@hotmail.com.  It should work.  I also
faced the same problem.

good luck
surya


--- ruggerizzo@libero.it wrote:
> Hello everybody!
> I'm a new TOmcat 4.0 user.
> I installed it on a Win NT 4.0 pc. The server starts
> and processes
> simple jsp pages (without <jsp:useBean...> or
> similar instructions).
> I need to use a bean. It's a java file named
> MysqlDb, it handles the
> connection to a Mysql Database and do other useful
> stuff.I compiled it
> and copied the .class file in the WEB-INF/classes
> directory of my web
> application (it's named 'reti' and it's in
> $CATALINA_HOME\webapps
> directory. My $CATALINA_HOME is
> 'c:\damiani-reti\jakarta-tomcat-
> 4.0.1'). The application is a simple Form that sends
> data to the jsp
> file. In it I call the bean:
> <jsp:useBean id="dbh" scope="application"
> class="my.MysqlDb" />
> 
> but the server gives me the error:
> 
> org.apache.jasper.JasperException: Unable to compile
> class for JSP
> 
> An error occurred at line: 15 in the jsp file:
> /query.jsp
> 
> Generated servlet error:
> C:\damiani-reti\jakarta-tomcat-4.0.1
> \work\localhost\reti\query$jsp.java:77: Class
> org.apache.jsp.MysqlDb
> not found.
>                 MysqlDb dbh = null;
> and so on...
> 
> The web.xml file is the one given in the
> documentation. I don't use any
> servlet so it's very simple.
> I tried to find a solution reading pieces of the
> servlet-2.3
> specification and the jsp-1.1 specification, the
> docs included with
> tomcat... but I didn't find any solution...
> hope someone can help me :-)
> 
> Thank u!
> see ya!
> 
> Ruggero.
> 
> 
> --
> To unsubscribe:  
> <ma...@jakarta.apache.org>
> For additional commands:
> <ma...@jakarta.apache.org>
> Troubles with the list:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>