facebook

Using MyEclipse for existing STRUTS project

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #231093 Reply

    Dear members,

    I have to enhance an already existing web project which
    was built using struts.

    To have more comfort I purchased myEclipse and I wonder
    how I can add a new project to use the struts features of
    myEclipse. I don´t want eclipse to chance any of the existing
    config files (would destroy my project).

    I tried Import but it changed web.xml and more…

    Any hints for me?

    TIA,
    Andi

    #231105 Reply

    Riyad Kalla
    Member

    Andi,
    What kind of project is this project? Is it a standard Eclipse project? Also the directory structure of your project is going to play a vital role on how it should be imported… can you type out the hierarchical directory structure of the project with little descriptions next to each dir telling what it does? Also be sure to wrap the text in code blocks (use code button below) so it maintains it’s formatting. Then I can likely give some suggestions on how to do this.

    #231115 Reply

    Hi Riyad, thanks for your help. Ok, I wasn´t specific enough.
    Actually, it is a web project which was manually put together.
    For building I use ANT with a working build.xml file.
    Directory structure follows:

    
    webManager
        docs
        docs-api
        dist
        build <- ANT distributes to this directory
        Web-Inf
            config   <<< contains 3 subdirs with config files
                app                          
                    struts-config.xml
                    tiles-defs-xml
                    forms-config.xml
                id
                    struts-config.xml
                    tiles-defs-xml
                    forms-config.xml
                del
                  struts-config.xml
                    tiles-defs-xml
                    forms-config.xml
                priv
                  struts-config.xml
                    tiles-defs-xml
                    forms-config.xml
                renderers-config
                objects-config
                validator-rules
                validation.xml
            configSelf
            lib << contains jar-Files
            web.xml
        Meta-inf
        src
            com << Java-Files
            jsp
            resources
                languages
                snippets
                styles
                images
        ext-libs
            commons-el.jar
            jsp-api.jar
            servlet-api.jar
        .classpath
        build.bat
        build.xml
        webCenter.xml
    
    
        
    #231116 Reply

    Riyad Kalla
    Member

    Can you change the layout of this project at all, or is this absolutely set in stone?

    #231119 Reply

    The tree is set in stone. But it would not a problem for me
    to build up a 2nd tree in the eclipse workspace. I could edit
    there and transfer the changed files into the “stoned” tree 🙂
    Not very comfortable, but an option.

    #231121 Reply

    Riyad Kalla
    Member

    Ok to get an idea of what I’m doing, create a new Web Project, notice how you have a structure like:

    Project Root
    src dir
    Web Root
    WEB-INF
    classes
    lib

    In your tree above, your “web root” is actually the same as your “project root”, while MyEclipse can sometimes handle this, it really isn’t too crazy about it. Also note that you will need to create a “classes” dir under your WEB-INF dir, and set that as your Output directory. So try the following:

    1) Add web capabilities to this project
    2) Set your web root to / and set your web context root to whatever you want (/myapp for example).
    3) Hit OK
    4) MyEclipse likely created the classes dir for you and adjusted your output dir from your source folder to be that folder, double check that it is (Project properties > Java Build Path > Source tab)
    5) Try and deploy the project to Tomcat, did it work?

    If it did, then you should be in business (you might have issues with taglib resolution… not sure).

    #231139 Reply

    Thanks a lot, Riyad. I will try it and will let you know here, how it went.
    All I have now is a text editor 😉

    #231318 Reply

    Hi,

    actually I am not sure how to import my existing
    scr, Web-inf and Meta-Inf into the new web project
    I created.

    Andi

    #231321 Reply

    Scott Anderson
    Participant

    Andi,

    You can simply copy and past them from another Eclipse project, using the Package Explorer View. Or, if they’re external to Eclipse, on the file system, you can drag the contents from the Window Explorer into the appropriate folders of your project in the Package Explorer View. Please note that both these options create a copy of the original artifacts; it doesn’t move them.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: Using MyEclipse for existing STRUTS project

You must be logged in to post in the forum log in