Directory Structure & Packages

Hi
I'm using Tomcat 3.3 to deploy my app, on Win 2K. I have some jsp files in webapps\myApp\*.jsp , and some additional jsp files in a subfolder of this called webapps\myApp\admin\*.jsp. These are protected by additional security restrictions.
I want both groups of jsp files to be able to access a bean that I have under webapps\myApp\WEB-INF\classes\*.class. The jsp pages under admin fail to find the bean because they expect it to be in a package called admin.
Any ideas?

Try setting the scope attibute of the bean first.
There are 4 ways to set the scope of a bean and they are;
<b>Page</b>
This is bound to the local variable. The bean object should be placed in the <i>PageContext</i> object for the duration of the current request. Storing the object there means thatsevlet code can access it by calling getAttribute on the pageContext variable.
<b>application</b>
It is also bound to the local variable but is also stored in the shared <i>ServletContext</i>. It is available through the application variable or by a call to <i>getServletContext()</i>. <i>ServletContext</i>is shared by all servlets in the same web application and values can be retrieved from the <i>ServletContext</i> by the getAttribute method.
This can do 2 things for you.
1 It allows for multiple servlets and JSP pages to access the same object.
2 It allows for servlets to create a bean that will be used in JSP pages, not just access one prieviously created. This is great when you are following the MVC architecture(or model 2 approach) because the servlet is able to handle complexe interactions and forward the results to an appropriate JSP page.
<b>session</b>
Also bound to the local variable but it also means that the bean will also be stores in the <i>HttpSession</i> object for the duration of the current request. It can be retrieved using the getAttribute method.
<b>request</b>
Again bound to the local variable but als to <i>ServletRequest</i> objectfor the duration of the current request.It can be made available with the getAttribute method. Storing values in the request object is common when using the MVC (model2) architecture.
You would set this option in the following;
<jsp:useBean id="blah" class="package.directory.BlahBlah" scope="application">
<%-- scope could equal any of the 4 dependiong on your needs --%>
I hope this helps.

Similar Messages

  • Problem with package and directory structure

    Please... I need help with a directory/package structure that I don't understand
    why it is not working...
    I want to create a custom login SWF which several other SWF movies will use in case they need some kind of login logic (in this case it is a login logic... but the problem doesn't have anything to do with that logic...)
    I have created a FLA movie (LOGIN.FLA) and two helper classes (MAINLOGIN.AS and MAINLOGINEVENT.AS)... they are all under the same directory, for example:
    c:\
         abc\
              def\
                   ghi\
                        login
    In LOGIN.FLA, I have included the source path, c:\abc (for example).
    MAINLOGIN.AS and MAINLOGINEVENT.AS, have both a package like:
         package def.ghi.login
    MainLogin class uses MainLoginEvent (it dispatches events of that type)... but I don't have to import anything as all 3files are in the same directory...
    LOGIN.FLA has its class defined as def.ghi.login.MainLogin
    And that's all... now comes the problem:
    1. If I leave everything as described and try to publis LOGIN.FLA, it throws error 5001 ("The name of the package def.ghi.login.MainLoginEvent doesn't reflect....) for class MainLoginEvent... don't understand why... it is placed exactly as MainLogin and has the same package definition!
    2. I have tried several other options, but when I get the SWF to get published, then, the problem comes when trying to use this SWF from another movie:
    The way to publish LOGIN.FLA with no errors is: MAINLOGIN.AS and MAINLOGINEVENT.AS with empty package definition ("package" alone...) and LOGIN.FLA with class MainLogin (not def.ghi.login.MainLogin)... LOGIN.FLA doesn't have to include source path to c;\abc in this case. This way, I can publish LOGIN and get LOGIN.SWF.
    The problem now is how to use this information from another Movieclip... I want to be able to use and receive events of type MainLoginEvent but can't (it gives error 5001 again, on MainLoginEvent, saying that the name of the package '' doesnt' reflect....)... If I include the path to c:\abc\def\ghi\login on the FLA, then it gives errors in MainLogin when trying to use a class of its library...
    Basically, the problem here is that, the movie which wants to use the LOGIN.SWF, is in c:\abc\def, and it is including the source path c:\abc, so if I import def.ghi.login.*
    it is when it throws error 5001 (I understand why, but I dont know how to fix it...), but if I dont import def.ghi.login.* then I can't use MainLogin nor MainLoginEvent...
    What is the good way of doing this kind of structure... mainly it is creating a SWF, which can be used from other SWF's and which can dispatch events, which the container SWF will capture...
    If anyone can please give me a hint... THANK YOU!

    Hi kglad , I don't understand the first point... "don't use absolute paths"... I'm not using them (or I don't understand what you mean).
    For the second one... the structure is like:
    c:\
         abc\
              def\
                   LOGINCONTAINER.FLA
                   ghi\
                        login\
                             LOGIN.FLA
                             MAINLOGIN.AS
                             MAINLOGINEVENT.AS
    In LOGIN.FLA, I include the source path c:\abc, so MAINLOGIN.AS and MAINLOGINEVENT.AS have a package of "def.ghi.login", and the class for LOGIN.FLA is "def.ghi.login.MainLogin"... when trying to publish LOGIN.FLA, Flash throws error 5001 for MAINLOGINEVENT...¿?
    What I want to get is a SWF (LOGIN.SWF), which can be loaded from any other SWF (in this example, LOGINCONTAINER.SWF). LOGINCONTAINER.FLA, has a class path "c:\abc" (the same as the other LOGIN.FLA, because of the directory structure), and it has to be able to receive events of type MAINLOGINEVENT... that is why it has to do an import of "import def.ghi.login.*" (for example)
    Any idea of why it is not working (or how to organize it correctly)?
    Thank you

  • Package and Directory Structure

    Hello --
    I work in a group that supports 3 web sites. (b2b, b2c, b2e)
    We're just beginning to develop Java in-house and
    currently using Solaris and JDK 1.2.x.
    I need to propose a package and directory structure strategy.
    The "reverse the domain name" guideline makes sense to me.
    My first thoughts are: ("classes" dir could be created anywhere)
    classes/com/ppco/b2X/ <--- for .java and .class files (development)
    lib/ <--- for b2X JAR files (ready for test or production)
    util/ <--- for our utility classes like DBAccessor
    lib/ <--- for our JAR files
    sun/ <--- for classes like com.sun.mail pkg
    lib/ <--- for JAR files like mail.jar
    org/ <--- for classes in org.omg.CORBA pkg
    lib/ <--- for JAR files
    We need to handle 3rd party classes.
    Development would be done in the b2X tree and JAR files would
    be installed the lib/ dir for testing and release to production.
    Does anyone have recommendations or experiences to share ?
    Are there some things to avoid ?
    Thanks !
    Al

    Hello Al,
    you are on the right track. A typical convention I follow is:
    <project>
          bin - for startup scripts, etc. to run your application
          build - for build scripts (not necessary if you build using your IDE. See below.)
          classes - for my compiled classes
          lib - for my 3rd party libraries
          src - for my source code
          test - for my test code (see http://junit.org/ )
    That's the project hierarchy. The src (i.e. the package heirarchy) structure is another story.
    As you say, you start with the reverse domain name. This is to give your packages a unique namespace. After that, your best guide is practice. Packages can be larger or smaller, depending on your coding practices. Usually you would have these (exact names may differ), plus others:
          com/ppco/client
          com/ppco/server
          com/ppco/common
          com/ppco/db
    I think your break down of sun, org, etc. is a bit too much. If you would like to do so, however, I recommend you do the separation under /lib. This way, the top level project directory is not polluted by the different types of libraries in use.
    Regards,
    Manuel Amago.
    From build above: I would suggest you always build your release distribution directly with the JDK, not using any IDE compiler. This is because Sun's JDK is the reference implementation, thus, any compatibility issues are not yours.
    An easy way to achieve this is by using ANT (see http://jakarta.apache.ort/ant/ ).

  • Best practices for package directory structure?

    I've only compiled a few java programs & while I find the language itself very easy to adapt to from C++ and Javascript, I get confused about the directory structure and classpaths & such.
    My main method of operation is to build small tools and test projects, and I would like to follow good practices for organizing my directory structure, so it will (a) work well with java, and (b) work well with my source control software.
    Let's say I am developing packages named "com.example.test.test1", "com.example.test.test2", "com.example.tools.flapper", and "com.example.tools.spinner".
    I know I can use this structure:
    /java/test/test1/com/example/test/test1/* (files for com.example.test.test1 including test1.java)
    /java/test/test2/com/example/test/test2/* (files for com.example.test.test2 including test2.java)
    /java/tools/flapper/com/example/tools/flapper/* (files for com.example.tools.flapper including flapper.java)
    /java/tools/spinner/com/example/tools/spinner/* (files for com.example.tools.spinner including spinner.java)
    But the directories seem unnecessarily deep & lead to a hassle in source control that makes it difficult to browse.
    Can I use this? and if so, how do I run "javac" and "jar" properly to compile/jar-ify each package?
    /java/com/example/test/test1/* (files for com.example.test.test1)
    /java/com/example/test/test2/* (files for com.example.test.test2)
    /java/com/example/tools/flapper/* (files for com.example.tools.flapper)
    /java/com/example/tools/spinner/* (files for com.example.tools.spinner)
    also is it recommended to leave the .class files in the same dirs as the .java files, or better to have a separate tree for compiled .class files?

    hmm, there's a lot to absorb here...
    I found these articles online that seem good:
    http://www.onjava.com/pub/a/onjava/2003/12/17/ant_bestpractices.html
    http://www.kevinboone.com/classpath.html
    I'd like to use ant if possible & understand it; I've had troubles with IDEs in the past and would like to just stick with basic build mechanisms.
    I guess as a practical example let's say I have two different applications that use the serial port, that I want to release separately, each in separate .jar files. One is called com.example.applications.serial1 and the other is com.example.applications.serial2. They both use rxtx.org's gnu.io.* libraries. Serial1 uses some packages that I have developed: com.example.tools.spinner and com.example.tools.flapper, whereas Serial2 uses com.example.tools.spinner and com.example.tools.flopper
    I think I want to organize things this way: (everything below under /java/src/)
    com
    example
    applications
    serial1
    serial1.java
    serial2
    serial2.java
    tools
    spinner
    spinner.java
    flapper
    flapper.java
    flopper
    flopper.java
    and I think I want to compile to /java/classes/:
    com
    example
    applications
    serial1
    serial1.class
    serial2
    serial2.class
    tools
    spinner
    spinner.class
    flapper
    flapper.class
    flopper
    flopper.class
    but I'm sort of lost on where to put the ant buildfiles, which directories to be in to run javac, and how to get the jar files right. From what I've searched for online, the external libraries (RXTX's jar files & .dlls for windows) are "interesting", and the easiest thing is to tell users of my .jar files to put the rxtx libs in the same library as the .jar files so I can set the Class-Path: in the .jar manifest to point to them.

  • 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

  • Zip and directory or package

    How on earth do I zip a package like an Omnigraffle file? I have a nice folder-action script that zips a file into an archive when it is dropped into the folder, but when I dropped an omnigraffle file into the folder it broke it into all the files that the original omnigraffle file consisted of, in other words it treats the file like a directory and breaks it open. I guess omnigraffle files are packages. If I use ditto it complains and tells me that the file is a directory. I cannot find any zip parameter that allows me to compress an omnigraffle file and keep it is a single compressed file. If I right-click and select compress on a file OS X has no problem and I get a single compressed file with the name and a .zip appended, but if I execute the zip application in terminal, or from my script, I get all the tiffs and jpegs and bits and bobs that the omnigraffle file is built with and the file it a goner.
    Most frustrating.
    Thanks for any help.
    Lawrence

    Well - that's done, works fine. The issue I was having was that I wanted files to be zipped into an archive without any path, so I would include the -j parameter. The -j parameter however would not only NOT store the path of the file, but it would also NOT store directory names.
    Okay - I thought. There is the -r parameter, this tells zip to travel the directory structure recursively thus picking up sub-directory content. However the -j conflicts with this and what I found was that zip would take the contents of any sub-directory and stick it at the same level as anything outside the folder.
    At first I thought this would be okay as I wanted this script to be used for ONLY files. However when I added an Omnigraffle file I was stuck as these are packages, and zip views them as directories. So any omnigraffle file would essentially be burst into its component parts, all rendered as files, at the root level of the archive folder. A total no-no.
    If I removed the -j, so that directories would be read and compressed, as well as the omnigraffle files, everything worked fine. Only now each file had a great long file path rooted at /System/user/me..... If I decompressed the zip archive I got a folder named "System" inside which was a folder named "user" and inside that was "me" and on and on until I finally got a folder with my unzipped files in it.
    Horrible.
    I realized that the key word in "man zip" was that the file path zip uses is relative to where the zip is running, and I was running it as a folder action which defaulted to the root, hence the vast great file path. So all I needed to do was to modify the script so that the zip command references just the file names without path, and then do a cd to the archive directory immediately prior to the zip command itself. Thus I implemented a "do shell script" which had two commands on the same line, separated by a semi-colon, the first command being the cd with the full path to the archive folder and the second being the zip without any paths at all and using just the -r parameter.
    Bingo.
    Thanks for everyone's help.
    Lawrence

  • Directory structure for a J2SE+J2EE project: suggestions are very welcome

    Hi, I have to start coding and organizing the CVS tree of an already mature project which is J2SE. This J2SE project can be described as a "core engine" for something else, and is a quite large project, and up to now has only a command line User Interface. I organized the dir structure as this:
    /build.xml
    /src/
    /src/java/<package>/...../*.java
    /src/demo/<package/...../*.java
    /src/test/<package>/....../*.java
    when I ant compile, all the .classes will be done in the "build" directory (reflecting the structure in the "src" dir):
    /build/
    /build/java/<package>/....../*.class
    /build/demo/<package/...../*.class
    /build/test/<package>/..../*.class
    I am happy with this, but now comes the issue: a web interface to use this core engine (it will have the same package namespace) is in developing progess, so I have to put somewhere the *.jsp, the WEB-INF dir with web.xml and servlet sources: how would you do this? And where would you let Ant put the compiled servlet classes?
    I can modify the previous directory structure to accomodate the J2EE part, this is really not a problem!
    Thanks to who can suggest me a clean solution
    Alessio

    Create a web-inf folder at the same level of src and
    jsp folder inside src
    i mean
    /build.xml
    /src/
    /src/java/<package>/...../*.java
    /src/demo/<package/...../*.java
    /src/test/<package>/....../*.java
    /src/jsp
    /web-infSo, would you put in /src/jsp only the *.jsp?
    And what in /WEB-INF ? What woud you put there? Would you do something like:
    /WEB-INF/web.xml
    /WEB-INF/src/<package>/..../<my_servlets_and_j2ee_stuff>.java
    /WEB-INF/classes/<package>/..../<my_servlets_and_j2ee_stuff>.java
    In this manner sources and classes are in the same tree, it does not seem very clean to me, expecially if you consider that probably I must have a "test" directory to unit test some j2ee stuff (as for the j2se stuff in "src"): how would you do that?
    Is this directory structure anyway what you meant or not?
    alessio

  • Directory structure question...

    I've been w/ three different companies doing Java development now, and each time I've come in once the project is already in progress and the directory structure is set up. What I see is a similarity:
    com.<company name>.<project>.<sub-units>
    examples:com.delta.kiosk.server
    com.delphi.shipping.guiIs this a common way of laying out directories and if so, what is the benefit (other than standardization)?

    I always figures that it was primarily a namespace issue.
    org.apache.ecs.Attributes
    org.xml.sax.Attributes
    are examples of class names that would have resulted in a collision without the prefixes. A full class name has the package name before it so
    String
    java.lang.String
    are the same thing, String is just shorthand for the latter. But if there are two of the same class then the prefix will help the compiler know where the class is supposed to come from. com.<company name>.<project>.<class> is a good way to ensure that you will not encounter a collision.

  • 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)

  • What should be directory structure for Custom MDS files?

    Hi,
    I have personalize a page and then exported the personalization.
    Now my requirment is to migrate this personalization to other server, for which clients want steps specific to UNIX.
    My doubt is where should I copy these files on the server to import the personalization using XMLImporter command? ( Client do not have JDev on his server, so can not use impot command)
    my custom_top structure is like '/u02/int/applmgr/CUSTOM/xbol/11.5.0'
    The customization is part of product 'OTA'
    I am confused about where to put(Directory structure on custom top) customization and other MDS file to import using XMLImport.
    This customization is also using a Custom LOV for which, I have given the path xbol/oracle/apps/ota/admin/enrollment/webui/XbolGradeRN.
    For now I have transfered the file from window based JDeveloper and things are working fine. I need the UNIX directory structure for MDS files.
    Please help to clear my this doubt.
    Regards,
    Adarsh

    There is nothing specific to UNIX since the files are never picked from the file system on a production instance. You can place them under a temp directory with the proper package structure, the same way you exported personalizations for the seeded pages and the same custom package structure for your new pages and run import command. It's only how you run your import command matters, if you have placed the files in the proper package under some temp directory just give the -rootdir to point to your temp directory and no -rootPackage option.

  • Archlinux Multilib Directory Structure?

    Hello,
    I was reading the Beginners' Guide for Arch Linux and I stumbled upon a sentence under Select an installation source which made me wonder. I have quoted it below:
    "If you are installing 64-bit Arch, you may also want 'multilib'."
    So I was wondering what exactly multilib was since the sentence implied it was optional. Following the multilib link didn't give me any explanation, but I found this article by redhat which explained the purpose of it. If I understood right, multilib makes it possible for me to use 32-bit applications on a 64-bit computer? If you can confirm, I will update the wiki to reflect my discoverings.
    That redhat article also mentioned that the 32-bit libraries and the 64-bit libraries end up in folders and that this directory structure can vary. In the table below the redhat article showed the directory structures for the Debian Core and the Fedora Core.
    (Source)
    My question is: What directory structure does multilib use in Archlinux?
    Thank you very much in advance!

    You can find such things out on your own:
    Click on "Packages" (on top of the site).
    Filter for "multilib".
    Click on a package named "lib32-*" (any will do).
    Click on "Package Contents View the file list for lib32-*".
    The package page is your friend! You can answer many many questions by simply looking up the package there. Also make sure you have a look at all the "Package Actions" on the right.
    Last edited by Awebb (2012-05-18 09:28:53)

  • Application Development Directory Structure

    I work with a team consisting of five programmers who want to rewrite a suite of software developed in C/C++ to Java. This will consist of numerous application programs; none of which are web-based. We use the UNIX OS and will access an Oracle database using JDBC. We also maintain our source code using CVS. We want to deploy each of our applications as a separate jar file. We would also like to identify either individual applications or groups of applications as Java packages. Our problem is setting up our development directory structure. We've been struggling with various structures, most of which work fine if our source files don't have a package statement, but we've had no luck finding a package statement that works.

    They aren't "extraneous levels", they are fundamental
    requirements of Java. Have a look at this
    http://java.sun.com/docs/books/tutorial/java/interpack/
    ackages.html. Any beginner Java book/article/tutorial
    should explain packages.Thanks for the url, I have perused numerous java books and searched the Sun site, but haven't found anything precise. In some locations I've seen it recommended to separate the source and classes in different directories, while other sources have them together in one file.
    Also, in response to an earlier comment, I think
    having different related applications under the same
    development tree and separated by packages is much
    easier to maintain/use/develope than having them all
    completely separate.We will have approximately 50 applications, with about 25 related to one application area and the other 25 related to another application area. The source for each of these application areas will be under CVS. To me it doesn't seem like the most convienent way to manage the software. But we'll have to do what we'll have to do.

  • What is the directory structure of EJB applications?

    I am new to EJB program. I know that after the development is done, we package the EJB components into .jar file, and package the Web components (HTML/JSP/Servlets/JavaBeans) into .war file, and then together we package .jar file and .war file into a single .ear file. Then we just deploy the .ear file into WebLogic's application directory.
    But, before the deployment, I mean during the development, what kind of directory structure is good for us to develop our EJB, HTML, JSP, Servlets, and JavaBean components?
    Previously, when I was doing JSP/Servlets applications, my directoy structure is:
    webapps\
    --------myapplication\
    -----------------------*.html
    -----------------------images\
    ------------------------------*.jpeg, *.gif
    -----------------------jsp\
    ------------------------------*.jsp
    -----------------------WEB-INF\
    ------------------------------web.xml
    ------------------------------classes\
    -------------------------------------Java Servlets located here
    -------------------------------------beans\
    -------------------------------------------JavaBeans are located here
    Now, I am doing EJB applications, what should be the directory structure?
    Thank you very much for your help!
    Jingzhi

    I have been involved in a few enterprise applications but have not been happy with the packaging structures used and am starting a new one now and am looking for other examples.
    this is what I've used before.
    web/
    classes/
    client/
    server/
    but if a class was used in the client and server it was put under the server/ package. I feel that more separation is needed.

  • An EFFECTIVE development directory structure for J2EE platform?

    Hi, here we r talking about deployment environment more than development
    environment. Have u ever think about designing an EFFECTIVE development
    directory structure for J2EE platform( e.g. weblogic )? u r not using the
    deployment directories for coding, r u? :)
    I used to construct a dir structure for dev and want to improve it.
    d:/wholesystem/*.prj // Project files
    ...../module1/src/com/.... // Module source files
    ...../module1/doc/... // Module doc files
    ...../module1/classes/... // Module class files
    ...../module2/...
    ...../web/*.jsp // web page files
    ...../web/images/... // web page images
    ...../web/WEB-INF/... //...
    Do u have any good ideas? Thanks!
    * Name: Gary Wang
    * Tele: 010-65546668-8119
    * Mail: [email protected]

    Create a web-inf folder at the same level of src and
    jsp folder inside src
    i mean
    /build.xml
    /src/
    /src/java/<package>/...../*.java
    /src/demo/<package/...../*.java
    /src/test/<package>/....../*.java
    /src/jsp
    /web-infSo, would you put in /src/jsp only the *.jsp?
    And what in /WEB-INF ? What woud you put there? Would you do something like:
    /WEB-INF/web.xml
    /WEB-INF/src/<package>/..../<my_servlets_and_j2ee_stuff>.java
    /WEB-INF/classes/<package>/..../<my_servlets_and_j2ee_stuff>.java
    In this manner sources and classes are in the same tree, it does not seem very clean to me, expecially if you consider that probably I must have a "test" directory to unit test some j2ee stuff (as for the j2se stuff in "src"): how would you do that?
    Is this directory structure anyway what you meant or not?
    alessio

  • Directory Structure Problem

    Hi i am niew to EJB
    my directory structure is like this
    App
    -----JSP,s
    -----WEB-INF
    --------classes
    -------package name
    -----------servlet class file
    -----PAckage Name
    -----------Sesion Bean Class File
    my servlet is calling the session bean but when i open this app in weblogic builder it only shows jsp/servlet related setting
    what is the correct directory structure
    jsp is calling a servlet which in turn calles a session bean
    kindly tell me
    Puneet

    I don't know why but weblogic builder sometimes behaves weird. Anyway, my suggestion is to try out to edit your application.xml manually.
    good luck,
    Fehmi

Maybe you are looking for