- This topic has 8 replies, 3 voices, and was last updated 19 years, 6 months ago by Scott Anderson.
-
AuthorPosts
-
Andreas B. ThunMemberDear 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
Riyad KallaMemberAndi,
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.
Andreas B. ThunMemberHi 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
Riyad KallaMemberCan you change the layout of this project at all, or is this absolutely set in stone?
Andreas B. ThunMemberThe 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.
Riyad KallaMemberOk 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
libIn 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).
Andreas B. ThunMemberThanks a lot, Riyad. I will try it and will let you know here, how it went.
All I have now is a text editor 😉
Andreas B. ThunMemberHi,
actually I am not sure how to import my existing
scr, Web-inf and Meta-Inf into the new web project
I created.Andi
Scott AndersonParticipantAndi,
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.
-
AuthorPosts