Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Tomcat can't find class that is placed directly under classes folder

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Tomcat can't find class that is placed directly under classes folder

    Respected PROGRAMMERS, There was a jsp file

    <%@ page import="foo.*" %>
    <html>
    <body>
    The page count is:
    <%=Counter.getCount()%>
    </body>
    </html>


    I kept "Counter" Class's package "foo" in

    C:\apache-tomcat-6.0.32\webapps\God\WEB-INF\classes
    and container could find the class from its package "foo"

    But when I try to keep some other class file directly under \WEB-INF\classes and not in any specific package such as "foo", then container can't find that class.

    Please help me


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,607
    My Mood
    Hungover
    Thanks
    145
    Thanked 658 Times in 563 Posts

    Default Re: Tomcat can't find class that is placed directly under classes folder

    I'm not sure which part is giving you trouble- accessing classes that DO have a package in the top-level classes directory, or accessing classes that DON'T have a package from a package-level directory?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Oct 2011
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Tomcat can't find class that is placed directly under classes folder

    Hi,
    I think in your case the import will be directly the file name without any package .
    Please try it
    <%@ page import="Content" %>

    bean factory
    Last edited by abani; December 18th, 2011 at 02:03 AM.

Similar Threads

  1. Paint program adding classes to main method class
    By Maxfmc in forum What's Wrong With My Code?
    Replies: 0
    Last Post: April 15th, 2011, 08:01 PM
  2. [SOLVED] can't run javac directly from command prompt
    By epezhman in forum Java IDEs
    Replies: 7
    Last Post: January 12th, 2011, 07:38 PM
  3. Applet cannot find client.class?
    By JoshRod in forum What's Wrong With My Code?
    Replies: 0
    Last Post: April 18th, 2010, 06:17 PM
  4. could not find the main class
    By Tisofa in forum Object Oriented Programming
    Replies: 1
    Last Post: September 27th, 2009, 03:58 AM
  5. Replies: 6
    Last Post: May 15th, 2009, 06:06 PM

Tags for this Thread