Results 1 to 2 of 2

Thread: beginners errors [Resolved]

  1. #1

    Thread Starter
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    beginners errors [Resolved]

    Here is the code for my class!
    Code:
    class hello 
    {
    	public static void main(String[] args) 
    	{
    		System.out.println("Hello World!");
    	}
    	public static String callme()
    	{
    		return "Trick Or Treat!";
    	}
    }
    here is the code for my jsp page.
    Code:
    <%@page import ="hello" %>
    <%
    	out.println("Hi Folks. Big Hello From TomCat!");
    	out.println(hello.callme());
    %>
    I have got TomCat installed on my machine. My class is lying in the same folder as the jsp. If I comment out the first and last line of code, I get the Big Hello from Tomcat.

    What do I need to fix?

    I am getting errors.

    Cheers,
    Abhijit
    Last edited by abhijit; Mar 30th, 2004 at 01:25 AM.

  2. #2

    Thread Starter
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228
    This problem has been resolved. Tomcat does not support import of classes. You have to put that class inside a package.


    Cheers,
    Abhijit

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