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 8 of 8

Thread: Class directory

  1. #1
    Junior Member
    Join Date
    Sep 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Class directory

    Can anyone tell me how to make my Java Server (update 11) see my JavaBean classes directory?
    ************************************************** ****************************
    I found the answer, it was simple. I began to use a Tomcat server and all I have to do now is edit the web.xml file and it works every time. Thanks for your input everyone.
    Last edited by Kit; January 6th, 2010 at 11:50 AM. Reason: Solved


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: Class directory

    What exactly do you mean, is this a Server you've written or what exactly do you mean?

    // Json

  3. #3
    Junior Member
    Join Date
    Sep 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Class directory

    Thanks for your reply Jason. The Java compiler is used in conjunction with aJava Server to run a JSP file. A class directory holds the classes to run JavaBeans. How do I get the Java server to run these classes?

  4. #4
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: Class directory

    I'm not entirely sure what you mean, when I write servlets and JSP's I use Tomcat as my application container. Are you saying you want to know how to build a simple .war file to use in your application container so you can see the jsp pages?

    // Json

  5. #5
    Junior Member
    Join Date
    Sep 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Class directory

    JSP files work fine, classes do not though. I have tried building a war file as for Tomcat but that does not seem to work out.
    Thanks for your replies I'll do a bit more digging into the server docs.

  6. #6
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: Class directory

    In your war file you need to have your .class files in the WEB-INF/classes folder so for instance if you have a class called MyClass in the package com.javaprogrammingforums the directory structure of that class would be.

    WEB-INF/classes/com/javaprogrammingforums/MyClass.class
    If you have any other external jar files you need as well these need to be in the WEB-INF/lib folder, for instance.

    WEB-INF/lib/log4j-1.2.15.jar
    // Json
    Last edited by Json; October 8th, 2009 at 03:44 AM.

  7. #7
    Junior Member
    Join Date
    Sep 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Class directory

    Thanks Jason, you are really trying to get round this one. My server does not seam to be able to see the WEB-INF directory and doesn't read the xml file installed there.

  8. #8
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: Class directory

    Could you give us a screenshot of the filestructure in your war file?

    // Json

Similar Threads

  1. Java program which can list all files in a given directory
    By JavaPF in forum Java Programming Tutorials
    Replies: 8
    Last Post: July 9th, 2013, 04:38 AM
  2. How to create directory in Java?
    By JavaPF in forum Java Programming Tutorials
    Replies: 2
    Last Post: December 24th, 2011, 12:53 PM
  3. Program to print current directory path to the console
    By JavaPF in forum Java Programming Tutorials
    Replies: 1
    Last Post: October 9th, 2009, 01:59 PM
  4. Virutal File Directory from Given dAta
    By hugsheals in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: July 28th, 2009, 04:39 AM