You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jim Cheesman <jc...@msl.es> on 2001/10/01 09:00:53 UTC

Re: Unable to use a javabean in an jsp page

At 06:54 PM 28/09/01, you wrote:

Try putting the bean in a package and running it - I think that tomcat 
requires this.



>I am a new user to Tomcat and seem to be having a fundamental problem with
>getting javabeans to work in a jsp page.  I have followed documentation to a
>T, but still no resolve.  Anyways, here's the outline of my problem....
>
>I created an application called "ch01" in the "webapps" directory on a
>Windows 2000 platform.  Here is my directory hierarchy:
>
>...webapps/ch01
>                        ->WEB-INF
>                                        ->classes
>                                        ->lib
>
>
>
>I have a jsp page in the "ch01" directory that called "test_javabean1.jsp"
>that creates a javabean that is located in the classes directory called
>"JavaBean1.class".  When I try to view the jsp page in a browser, I
>repeating get an error message stating that "class org.apache.jsp.JavaBean1
>not found".  I know that this jsp/javabean combination should work since it
>works flawlessly on a jrun server.
>
>The only thing I can think of is that my "ch01" application does not have a
>web.xml page in the WEB-INF directory.  If this is the problem, is there a
>template I can use?
>
>Also, my JavaBean1 class source code is below, is there anything I'm missing
>for Tomcat server?
>
>Any help would be much appreciated!
>
>Hoping to stand on the shoulders of geniuses, Rob.
>
>
>
>
>JavaBean1 source code............
>
>public class JavaBean1 {
>
>   private String message = "<b>Wow!  Dale is a nerd!</b>";
>
>   public JavaBean1() {
>   }
>
>   public void setMessage(String a) {
>     message = a;
>   }
>
>   public String getMessage() {
>     return message;
>   }
>}


--

                           *   Jim Cheesman   *
             Trabajo: 
jchees@msl.es - (34)(91) 724 9200 x 2360
               What is a free 
gift? Aren't all gifts free?