Project / Package structure..

Hi
I am currently prototyping some relatively simple BC4J / Struts / JSP applications in JDev.
I have followed the toystore demo which seems to have a nice clear and logical project / package structure for working with the MVC architecture.
However, i have found it very difficult to actually recreate this template when building my own prototypes using the built in wizards.
Example :
I have a Model.jpr separated into packages for BO / VO / services.
I want to create my Struts components (action classes and xml config) in a Controller.jpr and my presentation JSPs in a View.jpr
When using the web-tier wizards (JDev9.03) for a "complete struts based application" i can see no clear way of separating out the components ? It will package up the action classes into a package that i had no choice in creating / naming !?
I realise that if i use the subset wizards i have more control over where components are created (i.e. create an empty struts-xml, then add individual action classes etc. ) but it seems a shame that we can't do this within the complete application wizard.
Also,is there a way to create a new package without creating a "empty" business components package ? I have found myself creating the folder structure from windows explorer with a dummy java file in the relevant directory, then importing and editing the class to ensure compliance with my project design ?
How do you guys achieve these goals ?
Thanks in advance
Matt

Bump.

Similar Messages

  • Creating separate jars from one package structure

    Hello,
    I have the following package structure:
    project
    project.util
    project.mainAll of these packages are in the same classes directory. I would like to create one jar that contains project, one jar that contains project.util and one jar that contains project.main.
    The sub-packages jar correctly (each in its respective jar), however, the jar that supposed to contain ONLY the project package ends up containing the other two packages as well. If I say jar -cvf project.jar -C classes project it takes the entire project hierarchy (including util and main packages). If I say jar -cvf project.jar -C classes project\*.class it says that classes\project\*.class cannot be found. How can I limit the classes being jarred to not include the classes in the subdirectories?
    Please help. Thank you
    Elana

    Please help, anyone!
    Thanks

  • Organizing java projects, packages

    I'm making an application that has about 50 classes. I am using the project to learn how to do a lot of things, but one is how to use packages. I would like to get your comments on what I've done, since I've never done this before.
    I set up a directory called /java/classes/package_name/ for all my .class files.
    Likewise, /java/src/package_name/ has the source files.
    Now, I'd like to be able to build all the source files and put them into the appropriate class path directory. Is there a standard way of doing this? Do you use make? I like make, but is there a better tool? I like simple things.
    I have several classes in my package that have mutual dependencies. I think this is a bad thing, but it's because some of them are input dialogs and such, so I couldn't think of any way to handle buttons and input fields other than to have some mutual dependencies.
    I can't compile them at all because they depend on each other (or so I think). Is there a standard way to organize the GUI files like this? Do they not even belong in a package?
    If they don't belong in the package, where do they belong?
    I also want to be able to package this up nicely in a jar file or something so I can give it to friends to run (it's a game with some 2D graphics). I would have to include the class files in package_name package, but how do i related them to the main class when I jar them up?
    There are actually two programs that use all most of the files, and there could be more later.
    Thanks very much ahead of time; I appreciate all your info and tips.

    I am not opposed to learning to use Eclipse for Java type things,Good, good, good... also download and play with Netbeans, among others... use the one which suits you most... I use several IDE's for different jobs.
    but I'd rather learn to do it manually first. Otherwise I will by as mystified as ever when things go wrong.You'll go far. A BIG downside of the modern IDE's automatic build-and-deploy features is they hide all the "plumbing", which is great as long as it works, but leaves the user (esp noobs) totally at a loss when something goes wrong, coz the user doesn't even what should be happening... let alone what's not happening, or why, or what to do about it.
    Resolving dependencies like you suggested works fine when you don't have mutual dependencies.AFAIK the Java compiler doesn't have a problem building classes with "mutual dependencies"... for instance if class A uses class B which uses class A the compiler doesn't require a definition of type B (trusting that such will be forthcoming) when it compiles A... it then compiles B... and the picture is complete.
    An experiment to dis/prove the above notion
    package forums;
    public class A {
      public final String message = "A";
      public static void main(String[] args) {
        A a = new A();
        System.out.println(new B(a).message);
    class B {
      final String message;
      B (A a) {
        this.message = a.message + "B";
    }This works, so I don't get the whole "Resolving dependencies" problem. Do you know something that I don't?
    Javac "follows" dependendencies automatically, as long as the files are in the expected place.
    Me thinks you're just having classpath issues... you're directory structure must EXACTLY match your package structure... and remember that Java is cAsE sEnSiTiVe, even if the underlying operating system is not... ie: I think the "circular dependencies" problem is a furphy.
    Read that classpath article... of you're still stuck give us a yell and we'll work through compiling and running the above program.
    Cheers. Keith.

  • HowTo: Use package structure in generated code?

    Hi,
    I'm trying to find out if JCS is meeting my requirements for JSF development. So far it is pretty good, although the lack of support for new components is defeating the purpose of JSF for a great deal.
    One of the most terrible things I encountered so far is the fact that I've been unable to get JCS to create a package structure to contain the generated code. In other words, I want JSC to generate the code in "src/com.foo.bar.my.application" instead of just the root of "src/" (where src/ means the source-folder of my project).
    This is a real drawback.
    Maybe I'm wrong, but in that case it's a plain bug because I can't get it to work.
    Iwan

    Admitedly, Creator does not yet offer much flexibility in terms of user-defined package structure. I know you won't like this, but here's a workaround/hack that almost gets to where you want to be.
    First of all, the binding between jsp file and backing bean is defined by the relative positioning between the two files. A JSP file at the top level folder maps to a backing bean just under the assigned java package name (something like webapplicationxx). If you create a directory structure for your JSPs and create pages in them, Creator will create a corresponding package hierarchy for the backing beans.
    So, one way to contrive a java package structure such as com.foo.bar is as follows (best to start with a new project):
    1. Under the Web Pages folder, create a subfolder hierarchy "foo/bar".
    3. Under the Java Sources folder, rename the top level package to 'com'.
    4. You may now create Web pages in the foo/bar subfolder. You'll probably want to cut & paste the Resources directory into the foo/bar folder if you want to use stylesheets, etc. As the pages are created, notice that a com/foo/bar package structure is created under the Java Sources node where the backing beans are maintained.
    One final note, due to a bug in Creator, renaming the package in step 3 does not properly update references to the old pacakge in SessionBean1.java. These will have to be manually changed in the editor. Also note that the ApplicationBean1 and SessionBean1 files must remain at under to top-level package.
    We acknowledge this deficiency in Creator and are working to fix it in the next release.

  • Changing package structure through scripts

    Hi ,
    I have a project with huge number of files(around 2 thousand).
    I want to change the package structure of my source files.Previously no consistent approach is followed.so i want to correct that now.
    I can map each file to a new package structure.
    example: mypackage\common\sample.java = app\comon\Using this input i want to correct oackage and releated imports in my java files.Can any one help me write the best one
    or even if anyone can point to anything of this sort written earlier it would be of great help to me.
    Thanks in advance.

    ..And I am not looking for a simple search replace
    option...
    as it is very difficult for me to test this project.
    So, I am looking for a reliable way of changing
    package and import statements in the depending filesThis would still be a simple search and replace just with "package " and "import " in front of the package name to search for. But you would still have problems whenever the following is used:
    a.b.c.d.F bogus = new a.nb.c.d.F();As a matter of fact, simple search and replace (as long as it is done on the entire package name and not just parts of it) is probably your best bet, if you do not want to go the IDE way. There would probably still be a few mistakes, but there shouldn't be many (if your mapping is reliable). The other problem is would be if classes in one package are to be split into multiple packages, then have fun with any script you write to do it.

  • Compiling classes in their package structure

    I want to compile all classes using one command line
    I have the file structure.
    With .java files contained in two packages
    com.mine.FoldOne
    com.mine.FoldTwo so in the system
    C:/javaProj/src/com/mine/FoldTwo
    C:/javaProj/src/com/mine/FoldOne
    And the folder I want to compile too
    C:/JavaProj/classes
    FromC:/JavaProj I have tried javac @javaProj –d classes
    And
    Javac *.java –d classes
    And several variations of this
    Please tell me how I can compile all my packages using one command line.
    Thanks

    user10778915 wrote:
    Thanks for your advise i will look into building it with antIt's a good tool to know as your projects get more complex. However, if you really do just have 2 packages, then, as suggested by jschell, a simple batch script will suffice, and will probably be simpler. If you just want to get something going as quickly as possible, and don't expect a more complex package structure any time soon, ant may be overkill. But if you're going to be working on bigger projects in the near future, it's probably worth cutting your teeth on ant with a simple project now.

  • Error: A file found in a source-path must have the same package structure

    I use Adobe Flex Compiler (mxmlc) Version 4.1.0 build 16032,I have a file,named CustomGraphContainerController.as,it's directory is c:\controllers,and the GCController.as file is under the same directory,CustomGraphContainerController.as file like follows
    package controllers{
    import ui.GraphControlContainer;
    public class CustomGraphContainerController extends GCController {
      public function CustomGraphContainerController(a_graphControlContainer:GraphControlContainer) {
       super(a_graphControlContainer);
    Then I want to use mxmlc command to compile it,like follows:
    C:\>mxmlc c:\controllers\CustomGraphContainerController.as
    But it raise compile errors,like follows:
    Loading configuration file C:\sdk\frameworks\flex-config.xml
    C:\controllers\GCController.as: Error: A file found in a source-path must have the same package structure '', as the definition's package, 'controllers'.
    I don't know how to compile the as file with package controllers? Where is wrong? How to use mxmlc to compile it?
    Thanks

    HI,
         You should have one main application class to compile this as code to swf.. So that main application path should be in your proper package structure.. then you can compile you app and as files also...
    Thanks
    Ram..

  • What is package structure for Client ABAP Proxy?

    1.     What is the package structure need to be  followed for creating abap client proxy.
    2.     I read some where in the form, it need to be 4 levels. Why is it?
    Thank you
    Ganges Leaves

    Hi
    U hav to create a 4 level package structure for client ABAP proxy.
    U can create ur on packages
    1st level-structure package.
    2nd level-main package.
    3rd and 4th level-sub packages.
    To the 4th level only u hav to create proxy.
    The classes and code wil be automatically generated at the time of proxy creation.
    I think the 4 level structure bcz while in r/3 everythin in integration builder like software component version and all wil be takin as different levels.
    Also u can go through the weblogs in the above replies u got.
    Regards
    Victoria.

  • Creation of package structure for ABAP proxy scenario

    Hi All,
    I have a doubt on package structure used for ABAP proxy scenario. What is the specific reason to create a four level package structure? Can some one please explain? Thanks in advance.
    Regards,
    Sudheer.

    Hi Sudheer,
    Can you pls clarify what do you mean by 'four level package structure' ?
    Are you referring to the ABAP structures that get created during creating the proxy by SPROXY transaction ? These structures get automatically created. We simply have to write the code using these structures.
    Or do you mean the 'package' which is mandatory to create a transportable ABAP object ? i.e. transport from Development to Staging and then Production.
    Regards,

  • Project File Structure

    Where might I find an explanation of the PPro CS4 Project file structure? I cannot determine the logic where files are being distributed during a working session, and in particular if you have more than one project on a system.
    Thanks
    Gordon

    The project file structure is unfortunately not published.
    Cheers
    Eddie
    PremiereProPedia   (
    RSS feed)
    - Over 300 frequently answered questions
    - Over 250 free tutorials
    - Maintained by editors like
    you
    Forum FAQ

  • Package structure suitable for entity beans

    hi,
    I have to manage some good number of entity beans ( around 250 )
    is it a good idea to package these beans.
    i mean what number of packages could be an idea one.
    currently we have 5 packages and around 50 beans will be in each.
    can anybody suggest on this..

    package structure should be based more on the business context rather than number of beans. Usually it is of the form..
    org/com.<company_name>.<proj_name>.<context>.entity
    for instance...a good package structe example is
    org.apache.log4j.Category !
    If you have customer and order beans then
    com.walmart.pos.customer.entity
    com.walmart.pos.order.entity
    hth...
    sanjay.

  • Four layered package structure for ABAP proxies

    Hi
    I am trying to generate an outbound ( client ) abap proxy in our WAS 640 based ERP system by pointing to a XI message interface on the XI integration repository. I have a single package ZPROXY ( not a main or a structure package ) created in our ERP system to hold the proxy structures ( classes, interfaces ). I have this package assigned to a transport layer ( a common transport layer through which other ABAP objects are to be transported ). Is it really necessary to have a four layer package structures for proxies to be transported and work in the QA/Production system ?

    Hi Sudheer,
    Can you pls clarify what do you mean by 'four level package structure' ?
    Are you referring to the ABAP structures that get created during creating the proxy by SPROXY transaction ? These structures get automatically created. We simply have to write the code using these structures.
    Or do you mean the 'package' which is mandatory to create a transportable ABAP object ? i.e. transport from Development to Staging and then Production.
    Regards,

  • Loading images inside the package structure

    i am having trouble loading images that are imbedded into the package structure. I am assuming this is possible(99.9% sure)
    the classes are
    cardgameframework/CardGame.class
    cardgameframework/cardsupport/Card.class
    cardgameframework/cardsupport/images/2D.GIF
    cardgameframework/cardsupport/images/2C.GIF
    how do i load 2D.gif and 2C.gif from CardGame
    i tried
    Image i = Toolkit.getDefaultToolkit.getImage(
    "/cardgameframe/cardsupport/images/2C.GIF");
    and
    Image i = Toolkit.getDefaultToolkit.getImage(getClass().getResource(
    "/cardgameframe/cardsupport/images/2C.GIF"));
    but neither of these seem 2 work
    any help would be appreciated

    My initial thought is that you've got the package wrong in your two examples - you've got cardgameframe and not cardgameframework.
    Anyway, I tend to use the latter of your approaches - getClass().getResource("/cardgameframework/cardsupport/images/2D.GIF").
    Be careful of case in your URLs.
    Note that if getResource can't find your file it will return null - ensure that you're getting back a non-null URL:
    URL url = getClass().getResource("/cardgameframework/cardsupport/images/2D.GIF");
    System.out.println("URL: " + url);
    ...If your URL is non-null then the problem will be with the format of your image file (if it is null then you'll get a NullPointerException eventually).
    Hope this helps.

  • Package structure

    Well i actually develop a soft and i have a little question about packages structure.
    My application is composed is composed of a main JFrame with a JDesktopPane and
    a primary JInternalFrame. Some others JIF are used and in order to make it clear,
    i try to use this structure for the implementation.
    In my main directory, the Gui is placed. All the JIF are placed in a subdirectory called
    GuiFrames (and also as a package GuiFrames). For some reasons, I have to give the Gui class
    as argument to the JIF in order to keep a link to the main frame when switching from one
    JIF to another (there will be only one JIF visible in the JFrame).
    The problem is that the reference i use (ie the mainclass name) throw me to a
    "can't resolve symbol ..." problem. I don't know how to make a reference to a class that is just above in such a structure.
    let's resume it through this small draw :
    MainClass.java
    |
    |
    --> Package GuiFrames
    .... |
    .... --> JIFrameOne.java
    .... |
    .... --> JIFrameTwo.java
    .... |
    .... --> JIFrameThree.java
    .... |
    .... --> JIFrameFour.java
    .... |
    .... --> JIFrameFive.java
    In each JIFramexxxx.java, i need a link to MainClass.java, but MainClass.java can't be found from the package GuiFrames.
    Any suggestion would be welcome.
    Marc.
    PS: the easiest way would be to put all the JIF in the same directory as the MainClass, but i would avoid this for some development reasons.

    Put your MainClass in a specified package (instead of the default, nameless package as you have now) and import it in your JIFrame... classes.
    package MyPackage
    |
    --> MainClass.java
    .... |
    .... --> package GuiFrames
    .... .... |
    .... .... --> JIFrameOne.java
    so the source code looks like:
    // MainClass.java
    package MyPackage;
    public class MainClass {
    // JIFrameOne.java
    package MyPackage.GuiFrames;
    import MyPackage.MainClass;
    public class JIFrameOne {
    }Jesper

  • Sun recommended Java EE project directory structure?

    Hello,
    It's said that there's a Java EE project directory structure recommended by Sun.
    How to get it?
    I find a link as following,
    http://java.sun.com/blueprints/code/projectconventions.html
    The article is my want? Thanks!
    a cup of Java, cheers!
    Sha Jiang

    I got this worked out.

Maybe you are looking for

  • How do I stop my iphone from sending my imessages to another iphone on my account?

    When I updated my Iphone 4 to the new iOS 6.1 software I had to do a restore process and everything on my phone got deleted, and when I started texting, I realized that everytime I received an imessage from someone, it was also going to my sisters ip

  • TNS-12638 when shutting down the server

    Everytime when we shut down the database server (Win2K, Ora 9.2.0.1.0) we get the following entries in the log files: ora.log: Fatal NI connect error 12638, connecting to: (DESCRIPTION=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oracletest2)(ARGS='

  • What application opens a .wmv file?

    I've gotten several .wmv files in my email and being new to Macs I don't know what application opens these files. I can download them successfully however I always get an error message that says Saffari cannot open these files. Help!

  • Aironet 1260 AP

    I wanted to ask if I was looking to deploy a 1260 access point, would I need to replace the 4400 WLC with a 5500 or will the access point work with a 4400?

  • Pic storage

      Can someone tell me if it's possible and how to move pics from the phone memory to the SD card on my Z10?  I know you can set the camera to store pics on the SD card before you take them but I 'don't know how to move pics that are already in the ph