You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Juan <ve...@htmlspider.com.br> on 2002/06/07 22:53:13 UTC

Running JavaBeans

Hello,

I would like to use JavaBeans with jsp. Where is the "classes" directory? 
Is it automatically created? Or am I have to create it automatically?

The classes directory were created manually:
<<installdir>>\webapps\ROOT\WEB-INF\classes


Sorry, but I tried several things without success. I'm always getting a 
error message: class not found (JavaBean class).
May be I have to restart Tomcat or config webinf.xml

Thanks in advance,

Juan José Velázquez Garcia
Web Development
www.htmlspider.com.br



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


Re: Running JavaBeans

Posted by Adam Pfeiffer <ad...@yahoo.com>.
Hi Juan,
The path that you stated is correct:
<<installdir>>\webapps\ROOT\WEB-INF\classes

There are 2 important things to note.

1. If the classes are free standing (e.g. not jar'ed) and you have them as part of a package, you
must have directories corresponding to the package names.  I have a class name
PictureBrowserBean.class that is in package mada.trips so I have to have the following
<<installdir>>\webapps\ROOT\WEB-INF\classes\mada\trips\PictureBrowserBean.class

2. You will have to reload the webapp whenever you add/modify your classes.  Here are the
directions for that:

I have finally figured out how you can get a class to reload (e.g. Included JavaBean) without
having to stop/start tomcat using shutdown.sh and startup.sh.  First, follow the directions in
"Manager App HOW-TO" included with the tomcat documentation.  Once this is done, you can use the
manager app reload function to reload the web app.  This also refreshes any newly compiled classes
(e.g. javabeans) that you may have included in the JSPs.  To use the reload, do the following:

http://<IP Address>/manager/reload?path=<web app>

You can also use the manager to deploy new web apps, un-deploy web apps, start/stop web apps. 
This may be common sense to those tomcat veterans, but this was very helpful to me once I learned
how to use it.

OR

If you do not want to go through the above procedure, you can just stop and start tomcat with the
shutdown.bat/startup.bad  (I assume you are on windows because you are using backslashes)

Adam



--- Juan <ve...@htmlspider.com.br> wrote:
> Hello,
> 
> I would like to use JavaBeans with jsp. Where is the "classes" directory? 
> Is it automatically created? Or am I have to create it automatically?
> 
> The classes directory were created manually:
> <<installdir>>\webapps\ROOT\WEB-INF\classes
> 
> 
> Sorry, but I tried several things without success. I'm always getting a 
> error message: class not found (JavaBean class).
> May be I have to restart Tomcat or config webinf.xml
> 
> Thanks in advance,
> 
> Juan Jos� Vel�zquez Garcia
> Web Development
> www.htmlspider.com.br
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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


Re: Running JavaBeans

Posted by Markus Kirsten <ma...@iped.vxu.se>.
Hi Juan,
There's no need to edit the deployment descriptor but you need to 
restart Tomcat (or redeploy the application). The compiled bean should 
be placed in the /app/WEB-INF/classes directory. If you still don't get 
it to work send over your directory structure and the important part of 
your jsp file.

Using JavaBeans with JSP is really convinient and elegant after your JSP 
finds your bean. ;-)


Markus


On fredag, juni 7, 2002, at 10:53 , Juan wrote:

> Hello,
>
> I would like to use JavaBeans with jsp. Where is the "classes" 
> directory? Is it automatically created? Or am I have to create it 
> automatically?
>
> The classes directory were created manually:
> <<installdir>>\webapps\ROOT\WEB-INF\classes
>
>
> Sorry, but I tried several things without success. I'm always getting a 
> error message: class not found (JavaBean class).
> May be I have to restart Tomcat or config webinf.xml
>
> Thanks in advance,
>
> Juan José Velázquez Garcia
> Web Development
> www.htmlspider.com.br
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:tomcat-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-
> help@jakarta.apache.org>
>


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