Results 1 to 3 of 3

Thread: [solved] class not found

  1. #1

    Thread Starter
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552

    [solved] class not found

    i've installed tomcat 4.1.3 and jdk1.4.0 and here's the code i copied from the net. lol
    PHP Code:
    public class SimpleBean{
       
    String message="No message specified";
       public 
    String getMessage(){
          return 
    message;
       }
       public 
    void setMessage(String message){
          
    this.message=message;
       }

    i compiled it as javac SimpleBean.java in the directory tomcat_installed\webapps\pubs\example. so the class SimpleBean.class is in the directory. i also copied the .jsp in the same directory.
    Code:
    <html>
    <head>
    <title>Reusing JavaBeans in JSP</title>
    <style>
    body,table{
       font:9pt arial;
    }
    </style>
    </head>
    <body>
    <center>
    <table border=1 cellpadding=5>
    <tr><th>Reusing JavaBeans in JSP
    </table>
    
    <p>
    <jsp:useBean id="test" class="SimpleBean"/>
    <jsp:setProperty name="test"
       property="message"
       value="Hello WWW"/>
    
    <h2>Message:<i>
    <jsp:getProperty name="test" property="message"/>
    </i>
    </h2>
    </center>
    </body>
    </html>
    but it says something about class not found exception. i set the classpath to tomcat_installed\common\lib\servlet.jar. is there something i'm still missing. my friend told me about jsp-api.jar in the said directory but i can't find it.
    Attached Images Attached Images  
    Last edited by brown monkey; Jul 16th, 2004 at 10:28 PM.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    The class should go into
    webappbase/WEB-INF/classes/
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    i know i can count on you. thanks corned.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width