tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manu KY <manu_...@yahoo.com>
Subject Re: Unable to use a javabean in an jsp page
Date Fri, 28 Sep 2001 17:22:21 GMT
Hi ,
try these steps.

1.first of all , create a web.xml file in WEB-INF folder.
2.put the bean in a package such as org.rob

Manu
>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;
>   }
>}


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Mime
View raw message