Tomcat directory structure

Hi, I've programmed a client - server application based on an applet - servlet communication and all is running ok. I've my applet and all the classes needed by it in Root/ directory and my servlet and all the classes needed by it in Root/WEB-INF/classes/ directory. All clases have no structure. Te problem appears when I want to give a certain structure to all my classes (put them in certain packages).
For example, if my applet belongs to the packate myPackage I put it in Root/myPackage/ and if my servlet belongs to the package myServletPackage I put it in Root/WEB-INF/classes/myServletPackage/ and so on.
Finally I configure my web.xml file like this:
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>myServletPackage.ElServlet</servlet-class>
</servlet>
After restarting tomcat when I try to run the application It appear a No class foun exception.
Can anyone tell me what I'm doing wrong?
Thks and sorry for my english.

Sorry for my bad example. In fact I put the Root directory as an example, It's real name is MetroNet and, as I say on the previous topic the problem appear when I try to organize my classes in different packages.
thnks

Similar Messages

  • Tomcat directory structure + jsp

    Hi all,
    I have been trying for a long time now to setup my tomcat-directory as described, but I don't get my application running... My directory structure is currently as follows:
    d:\
        webapp\
             web\
                  WEB-INF\
                        classes\
                             servlet
                        libThe path for tomcat is set to d:\webapp\web, where my JSPs are. From the JSPs, I start some applets - the problem is, where do I have to put them? They are in the directory project; if I put this directory in WEB-INF/classes, they are not found. If I put them directly in the web-directory, they are found, but not the classes they depend on... I can then put all the classes I need in the web-directory, and my application runs, but as far as I understood, this is not the supposed setting :-( And besides, the only reason for the WEB-INF directory would then be the servlets inside (which run without problems!)
    Might I do something wrong in calling the applets? In the moment, I start them with <applet code="project/Start.class"> Or do I need to change something in the web.xml file?
    Thanks for any hints,
    Thea

    but as far as I understood, this is not the supposed setting That IS the appropriate setting.
    An applet runs on the client machine.
    Therefore the client has to download all the class files to run the applet.
    The client cannot download any classes that are under WEB-INF. WEB-INF directory is for the server only.
    Therefore any classes needed to run your applet must be outside of the WEB-INF folder, so they can be downloaded.
    JSP/Servlet code runs on the server side. The code for this you can put under WEB-INF, and it will only be available to the server. That way you have your application, but don't have the code freely downloadable.
    Cheers,
    evnafets

  • Web Application directory structure

    Please can someone help me with directing me to any online guide as to how webapp could be created and web.xml configuration in Sun Application server 8.
    I do not understand the directory structure of sun, unlike Tomcat the webapps contains all the virtual context part with a default ROOT direct set in the server.xml as the default docbase.
    Now, where is the default ROOT in Sun server? Where can I put my index file. When I create a web context, where will I put it? Does J2EE has similar WEB-INF structure in Tomcat? Does it have web.xml to configure the webapp
    Finally, I have written a simple EJB called Hello World using stateless protocol. I have my Hello.class, HelloHome.class and HelloBean.class. I also have ejb-jar.xml for container configuration. I have jar then up to hello.jar and have deployed them. Now I want to access the beans, Home bean to be precises. I have written a hello.jsp and I put it in the orignal directory where the main index.html file is in Sun server which is /user/Sun/AppServer/domains/domain1/docroot, I got errors.
    Could someone shade a light on this please.
    Thanks Guys.
    NB
    Do not point me to online reference
    I have awared max point for this question

    The developer's guide discusses in pretty clear terms how to deploy a J2EE app from a directory structure.
    The tomcat directory structure is really the same as a packaged war which once you read the documentation you will see is basically no different with SJSAS.
    You need to deploy an application. See previous posts on how to have docroot be the top level (search for posts by janluehe)

  • Project directory structure

    I'm do jsp development onto Tomcat and about 3 months ago moved to Jdev. I've set up my project to go against the Tomcat directory structure but am not sure this is the best thing to do when using jdev. Does anybody have a recommended directory structure to use for a project?

    I got this worked out.

  • Question re: Blaze DS Directory Structure Following Turnkey Installation

    Hello. I've been building client-side apps with flex for a while and have started getting into backend development.
    I have read up a fair bit on blaze ds and have downloaded the turnkey installation and successfully ran a few of the samples...but i have a couple of questions re: the directory structure if someone could help...i unzipped the turnkey into Blaze_ds folder on the desktop...
    a) .........\Blaze_ds\tomcat\webapps\blazeds\WEB-INF  - could u please explain the concept of the WEB-INF directory and the folders inside it (flex, src, classes, lib, etc.)
    b) ......... \Blaze_ds\tomcat\webapps\samples - there are all the samples in here (eg. testdrive-chat, testdrive-101, dashboard, etc.)...and there is also a WEB-INF and META-INF folders...just wondering why there isn't WEB-INF/META-INF inside each sample folder
    Finally, can someone also let me know the concept of localhost and the port number 8400 and are there any good books on blaze ds?
    thx!

    There's really not much difference. In some cases, you might already have a web application you are using so you could just copy the contents of the blazeds web app into your existing web application.
    Application servers can host more than one web application and a Flex application that uses BlazeDS can be deployed on a different web app than the one where BlazeDS is running or a different server entirely so it really just depends how you want to set things up.
    Hope I'm not just making things more confusing for you. . .
    -Alex

  • Directory structure of web sphere

    i did not get the directory structure of the web sphere 6.1 to deploy a sample application like webapps->dirname->WEB-INF->classes etc in tomcat server.
    The project is developed under tomcat but it has to be convert to the web sphere.

    please google..
    http://www.exforsys.com/tutorials/websphere/websphere-v5.0-workbench-basics-create-j2ee-projects.html
    http://publib.boulder.ibm.com/infocenter/wpfhelp/v6r1m2/index.jsp?topic=/com.bowstreet.designer.doc/designer/c_devenv_dir_structure.htm

  • Can't I change the directory structure?

              Hello Everybody,
              So far everything is working when use the default directory structure,i.e. mydomain/applications/myWebApp/WEB-INF/classes/some package structure.
              But we have application with lot of html files which call servlets like this..myWebApp/WebApp/myServlet.
              In order not to change my html files, I've created this WebApp directory under weblogic directory structure shown above.
              I've done some trial and error in web.xml file to make servlets execute. But 404 error is showing up.
              I tried putting in web.xml like this...
              <servlet>
              <servlet-name>/WebApp/HelloWorldServlet</servlet-name>
              <servlet-class>com.reliable.servlets.HelloWorldServlet</servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>HelloWorldServlet</servlet-name>
              <url-pattern>/WebApp/HelloWorldServlet/*</url-pattern>
              </servlet-mapping>
              I also tried taking out slash(/) before WebApp but no luck.
              Can any one guide how to make this work.
              Thanks so much,
              Sri
              

    What he needs is something like:
              <servlet>
              <servlet-name>HHH</servlet-name>
              <servlet-class>com.reliable.servlets.HelloWorldServlet</servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>HHH</servlet-name>
              <url-pattern>HelloWorldServlet/*</url-pattern>
              </servlet-mapping>
              HHH is simply to link the mapping declaration to the servlet declaration.
              Then the URL would be something like:
              http://myserver:8801/appname/HelloWorldServlet/abc
              If this is the default app, then appname/ drops out.
              There is a good discussion of this in our docs and
              the servlet spec discusses this as well.
              mark
              Keith wrote:
              > Hi Sri and Alfonso,
              > Did you ever get the code? I am interested in seeing how I can do that too. I
              > have to migrate my servlets and jsp from tomcat and all the html files are referencing
              > the servlets with this format:
              > http://abc/servlet/servletA
              >
              > Thanks!
              > keith
              >
              > "sri" <[email protected]> wrote:
              > >
              > >Hi Alfonso,
              > >Thanks for trying to help me. In your response you said "Just copy my code".
              > >But I didn't find any code in your reply.
              > >Can you please clarify.
              > >Thanks so much,
              > >Sri
              > >"alfonso" <[email protected]> wrote:
              > >>
              > >>You are in wrong, the servlet name is a short name to identify the servlet
              > >in xml file not in URL. You can not load many servlet without to register
              > >it,one by one. But i found a solution, that you can find in servlet without
              > >registration subject. (pe: we have servlets calls as http;//b2web/servlet/XXX)
              > >>just copy my code, or email me if you have problems to [email protected]
              > >>
              > >>"sri" <[email protected]> wrote:
              > >>>
              > >>>Hello Everybody,
              > >>>So far everything is working when use the default directory structure,i.e.
              > >mydomain/applications/myWebApp/WEB-INF/classes/some package structure.
              > >>>
              > >>>But we have application with lot of html files which call servlets like
              > >this..myWebApp/WebApp/myServlet.
              > >>>
              > >>>In order not to change my html files, I've created this WebApp directory
              > >under weblogic directory structure shown above.
              > >>>I've done some trial and error in web.xml file to make servlets execute.
              > >But 404 error is showing up.
              > >>>I tried putting in web.xml like this...
              > >>you are in wrong, the servlet name is
              > >>> <servlet>
              > >>> <servlet-name>/WebApp/HelloWorldServlet</servlet-name>
              > >>> <servlet-class>com.reliable.servlets.HelloWorldServlet</servlet-class>
              > >>> </servlet>
              > >>> <servlet-mapping>
              > >>> <servlet-name>HelloWorldServlet</servlet-name>
              > >>> <url-pattern>/WebApp/HelloWorldServlet/*</url-pattern>
              > >>> </servlet-mapping>
              > >>>
              > >>>I also tried taking out slash(/) before WebApp but no luck.
              > >>>
              > >>>Can any one guide how to make this work.
              > >>>
              > >>>Thanks so much,
              > >>>Sri
              > >>
              > >
              

  • Looking for Directory structure

    Hi i am new bie to Tomcat .
    i was wondering if some explain me the directory structure for a web Application.
    like where to put the HTML files and where to put the Java classes and where to keep the JSP
    and what is the Importance of WEB-INF dir
    Thanks in Advance.

    You should create a directory under the webapps and name any name, for example, name it projects and under the projects there should a WEB-INF directory which has a classes directory, under which you keep the .class files, may it be servlets or beans which are used in jsp's. And the normal html, pages from which you call either a servlet or a jsp on clicking a button or something will directly under the projects directory in our example.
    for example a LoginServlet will be in classes directory, the path will be
    C:\progra~1\apache~1.0\webapps\projects\WEB-INF\classes\LoginServlet.java
    and you can access the LoginServlet by giving this url
    http://localhost:8080/projects/servlet/LoginServlet
    hope this helps
    </ksenji>

  • How to not let others see tomcat directory

    I don't want to others see my tomcat's directory in my webapps. in other words, i want to prevent people from knowing my tomcat server directory structure by typing the url "http://202.38.248.1/Basic/"(Basic is a directory in ROOT which contain a lot of JSP pages). How to make it?

    Go to where your default Servlet is defined (probably in Tomcat/conf/web.xml) and add the init parameter:
            <init-param>
                <param-name>listings</param-name>
                <param-value>false</param-value>
            </init-param>to the <servlet>
      <servlet-name>default</servlet-nam>definition.

  • Import statement and directory structure

    First of all, sorry for such a long post, I believe part of it is because I am unsure of the concept of importing in Java. Secondly, Thanks to anyone who can ultimately enlighten me to the concept of import. I did ask this question before in the "erorr and error handling" forum, and the people who have helped me there did a great job. But, I believe I require a little more clarification and thus have decided to post here.
    Anyhow, my question..
    Could someone explain to me the concept of the import statement, or direct me to a webpage with sort of explanation for newbies? For some reason, I am having a hard time grasping the concept.
    As I understand it, the import statement in Java, is very similar to the namespace keyword in C. That is to say, import doesn't actually "import" any source code, the way that the #include statement does in C.
    So I suppose what my question is, say I have a java class file like below:
    //filename: sentence.java
    //located: c:\school\csc365
    package csc365;
    class sentence
    //some variables here..
    //some constructor here..
    //some methods here..
    And some sample program like the one below which implements the above..
    //filename: test.java
    //located: c:\school\csc365
    import csc365.*;
    import java.io.*;
    class test.java
    //creates some sentence object
    //uses the object's methods
    //some other things.
    As I understand it, the test.java file should not compile because the csc365 package is not in the correct directory. (assuming of course, the classpath is like c:\school\csc365;c:\school )
    But, ... where then should the sentence.java be located? In a subdirectory of c:\school called csc365 (i.e c:\school\csc365\) ?
    And thus that would mean the test.java file could be located anywhere on the hard drive?
    I suppose, I just need a little clarification on the correlation between a package's "name" (i.e package csc365; ) and its corresponding directory's name, and also how the javac compiler searches the classpath for java classes.
    ..So, theoretically if I were to set the classpath to look in every conceivable directory(provided the directory names were all unique) of the harddrive, then I could compile a test.java anywhere?
    As a note: I have been able to get the test.java file to compile, by leaving out the import statement in the test.java file, and also leaving out the package statement for the sentence class, but I assume this is because the files are defaulted to the same package?

    Hi Mary,
    No, import isn't analogous to C++ namespace - Java package is closer to the namespace mark.
    import is just a convenience for the programmer. You can go your whole Java career without ever writing an import statement if you wish. All that means is that you'll have to type out the fully-resolved class name every time you want to use a class that's in a package other than java.lang. Example:
    // NOTE: No import statements
    public class Family
       // NOTE: fully-resolved class names
       private java.util.List children = new java.util.ArrayList();
    }If you use the import statement, you can save yourself from typing:
    import java.util.ArrayList;
    import java.util.List;
    public class Family
       // NOTE: fully-resolved class names
       private List children = new ArrayList();
    }import isn't the same as class loader. It does not bring in any source code at all.
    import comes into play when you're compiling or running your code. Java will check to make sure that any "shorthand" class names you give it live in one of the packages you've imported. If it can't find a matching fully-resolved class name, it'll give you a message like "Symbol not found" or something like that.
    I arrange Java source in a directory structure that matches the package structure in the .class files.
    If I've got a Java source file like this:
    package foo.bar;
    public class Baz
       public static void main(String [] args)
            Baz baz = new Baz();
            System.out.println(baz);
       public String toString()
           return "I am a Baz";
    }I'll store it in a directory structure like this:
    root
    +---classes
    +---src
          +---foo
               +---bar
                    +---Baz.javaWhen I compile, I go to root and compile by typing this:
    javac -d classes foo/bar/*.javaI can run the code from root by typing:
    java -classpath classes foo.bar.BazI hope this wasn't patronizing or beneath you. I don't mean to be insulting. - MOD

  • Organize iTunes file list by Directory Structure instead of artist/album?

    Hello, I have searched for different audio players for os x which might have this feature but so far have had no luck. What I'm looking for is a feature similar to that of foobar2000 for win32 where I can organize my music by directory structure without the iTunes automatic organization by artist/album. Is there a way I can accomplish this in iTunes with some sort of xml config or hidden options? Thanks.

    You don't have to have iTunes move music around on your hard drive (Preferences>Advanced>General, uncheck Keep iTunes Music folder organized and Copy files to iTunes Music folder when adding to library) but I suspect that's not what you're asking. You can't automatically view music from within iTunes by directory structure. iTunes organizes by ID3 tags ("mp3 tags"). You could, I suppose, spend a lot of time replicating your directory structure by using folders and playlists within iTunes but you'd probably have to do it all by hand.
    You could check out Doug's Scripts to see if there are some scripts that might help.
    http://dougscripts.com/itunes/index.php

  • How to create a tree based on directory structure

    I want to create a hierarchical tree in Forms 6i based upon a file system directory structure (similar to Windows Explorer). How can I populate a tree with this information, is there something that I can call or write that would return the file system structure in a format that I can populate my tree?
    Any advice would be greatly appreciated.
    Thanks
    Richard

    Your link does not seem to work.They're re-jigging all the links to accomodate the hot poop on Oracle's latest and greatest, 10G. So at least the website is on schedule even if the actual software delivery dates have slipped :P
    We can still get D2KWUTIL from here: http://te chnet.oracle.com/software/products/forms/content.html
    Cheers, APC

  • Directory Structure for multiple applications at one host

    Can I have multiple (more than one) WEB-INF directory structures in the public_html directory for different web applications? If I do this, how do setup the url-pattern in the Servlet Mapping tag in the web.xml file? How do I setup the URL that calls the servlet from the HTML that has been send to the user�s browser?

    If I understand your question, you want multiple contexts. All App Servers/Web Servers allow you to setup multiple contexts. Normally if your root context is in /home/myhome/app_server/
    then you would setup multiple contexts by creating a folder for each context:
    /home/myhome/app_server/context1/
    /home/myhome/app_server/context2/
    Each would have their own full application/website. And the way to reference these would be as such:
    if the domain, www.mydomain.com, is mapped to /home/myhome/app_server/
    www.mydomain.com/context1/
    www.mydomain.com/context2/
    I think that is what you were asking. Hope it helps

  • Is there any way to specify a URL in the servlet-mapping that doesn't need to be in the directory structure?

              I migrated from WebLogic 5.1 to 7.0.2 Something I used to have set-up in 5.1 no
              longer
              works.
              I am using the weblogic.servlet.FileServlet and have the URL "/cxedocs/" mapped
              to this
              servlet. So whenever the URL http://localhost:7001/cxedocs/en_US/index.html
              is used it would use the docHome associated with the /cxedocs/ URL and then append
              the "en_US/index.html" on to it. So let's say d:\temp\en_US\index.html
              But now for WL 7.0.2 it appears that the URL also needs to be in the directory
              structure.
              So it now takes the docHome "d:\temp" adds the URL "/cxedocs/" and then appends
              the
              rest - so d:\temp\cxedocs\en_US\index.html.
              I can't require that the "cxedocs" directory be there. Is there anyway to map
              a certain URL
              without requiring it in the directory structure. I looked at virtual directory
              mapping too but
              it still seemed to require this.
              Any help would be appreciated!
              Thanks!
              -Lori
              

              I opened up a case with support on this. After some research they came back with
              that
              NO there is no way to do this. In 6.0 it was changed to follow the spec which
              restricts this.
              The URL must be part of the directory path.
              -Lori
              "Lori Ronning" <[email protected]> wrote:
              >
              >I migrated from WebLogic 5.1 to 7.0.2 Something I used to have set-up
              >in 5.1 no
              >longer
              >works.
              >
              >I am using the weblogic.servlet.FileServlet and have the URL "/cxedocs/"
              >mapped
              >to this
              >servlet. So whenever the URL http://localhost:7001/cxedocs/en_US/index.html
              >is used it would use the docHome associated with the /cxedocs/ URL and
              >then append
              >the "en_US/index.html" on to it. So let's say d:\temp\en_US\index.html
              >
              >But now for WL 7.0.2 it appears that the URL also needs to be in the
              >directory
              >structure.
              >So it now takes the docHome "d:\temp" adds the URL "/cxedocs/" and then
              >appends
              >the
              >rest - so d:\temp\cxedocs\en_US\index.html.
              >
              >I can't require that the "cxedocs" directory be there. Is there anyway
              >to map
              >a certain URL
              >without requiring it in the directory structure. I looked at virtual
              >directory
              >mapping too but
              >it still seemed to require this.
              >Any help would be appreciated!
              >Thanks!
              >-Lori
              

  • I have copied many photo's from another laptop to my Mac.  The older photo's are in directories with names that help me select what I need to view. I would like to have all my imported new photo's also bee added to the directory structure I have in Finder

    I have copied many photo's from another laptop to my Mac.  The older photo's are in directories with names that help me select what I need to view. I would like to have all my imported new photo's also bee added to the directory structure I have in Finder but my new photo's are all in iPhoto.  I want to use directories for storing and iPhoto for viewing.  Is this possible or do I need to have all my photo's in iPhoto??
    Mitch

    iPhoto is not a Photo Viewer. It's a Photo Manager and designed for looking after the files while you organise the Photos. It really works much better if you let it manage those files. If you use iPhoto you never go near those files because iPhoto is your start point for anything you want to do with your Photos - the point of the pplication.
    You can run iPhoto in Referenced mode, where it does not copy the files to the Library, but I caution you that you are making life a lot more difficult for yourself by doing that.
    How to, and some comments on why you shouldn't, are in this thread
    https://discussions.apple.com/thread/3062728?tstart=0
    Regards
    TD

Maybe you are looking for

  • Need this formula to look back 2 full years

    In the following code, we are looking to show all records, where, the part# had no sales for the 2 month period selected by the user. But we also do not want to show this part if the current onhand balance is o, and also, we do want to show when was

  • HT1386 I have exclamation points next to all of my iTunes songs.  How do I get rid of them?

    I started this yesterday, but I lost my converstations.  I'm not that computer savy.  Please help!  I cannot get rid of those exclamation points, and I can't play the music through my computer OR sync with my iPod Touch.  Help!!!!  I have Windows Vis

  • Invalid Cursor Position Error on Windows XP using CachedRowSet

    Hello, I don't know if this question lies here, but I thought it would be the well suited place so please pardon me if it isn't. I am trying to access multiple pages from my database on my XP machine but I am getting an "invalid cursor position" erro

  • BAPI- BAPI_PO_CHANGE - Buffer table not up to date

    Dear All, I am facing problem when updating PO using BAPI FM  "BAPI_PO_CHANGE". Using excel file i am uploading data to system and updating fields. Here excel file have more than 100 records. problem is if two documents have same error message first

  • My Photoshop 7 freezes on startup--why?

    When I try to open Photoshop 7, I get this message: "Updating Adobe Online components from Adobe.com Downloading file 1 of 2. No personal information is being transmitted. File: AWEXFILES.TXT To: macintosh hd:Library:ap...ion support:adobe:web" The c