- This topic has 3 replies, 3 voices, and was last updated 19 years, 3 months ago by Alexander Hauswald.
-
AuthorPosts
-
AMDOCS_NCMemberI have a web project with a structure like this:
JSPs live under
webapp/adminJava files live under
webapp/admin/web-inf/classesif i set my build path to webapp/admin, it won’t compile the java files because the package structure doesn’t match.
So i set up my project to have two build folders (webapp/admin and webapp/admin/web-inf/classes). Now everything builds correctly.
I set my output folder to <output> and this works great for my JSPs, JS, Image files, etc. However, all of the classes are compiled to <output>/com.
When i deploy the project, all the JSP, JS, images, XML files are deployed correctly, but the classes are all deployed under <web-root>/com (which is to be expected). For my webapp to run properly, I need for my classes to be under <web-root>/web-inf/classes.
If i could get the classes to compile to <output>/web-inf/classes and my JSPs to continue to compile to <output>/, then my deployment would fit my needs. Is this possible?
Another alternative may be to set my deployment to deploy <output>/com to <web-root>/web-inf/classes.
I am using eclipse 3.0 and myEclipse3.8.4.
Sorry for the long post.
Thanks!
Scott AndersonParticipantJava files live under
webapp/admin/web-inf/classesI wouldn’t recommend that. It seems from the location of your JSP’s that webapp/admin should be set as your WebRoot directory for your MyEclipse Web project. Since everything under the WebRoot is deployed to the server, placing Java in here is inappropriate, as you probably don’t intend that your source be deployed. What I’d suggest instead is that you create a Java source folder outside of the web root, say in webapp/src and set the build path so that it compiles into webapp/admin/web-inf/classes. That will put the class files in the correct location for deployment.
Another alternative would be to set both the Java source folder and it’s output location to webapp/admin/web-inf/classes, but that will also cause your Java source to be deployed, as mentioned above. So, moving your Java external to your web root would be the best solution to get you a deployable application. In the end, what’s under webapp/admin needs to look like an exploded WAR.
AMDOCS_NCMemberHi Scott,
Currently, my <output> contains the contents of webapp/admin (in <output>/) and the contents of webapp/admin/web-inf/classes (in <output>/com). This is ok, except for the compiled java classes being in <output>/com, I need them in <output>/web-inf/classes/com.
Our application has been architected to put the class files in webapp/admin/web-inf/classes/com so I can’t change that location. I only want the compiled classes to go there, not the actual java files (though our CVS does have them in this location, for some strange reason).
Currently, my build path includes, webapp/admin and webapp/admin/web-inf/classes, which allows the entire projects contents to be copied to <output>, making output look like my exploded war. When I remove webapp/admin and change the output to webapp/admin/web-inf/classes, only the java classes are put there.
So, I need to find a way to get my class files to <output>/web-inf/classes or get them to deploy from <output>/com to <web-root>/web-inf/classes/com.
I’ve tried about 5 or 6 different options and I can’t find the one that fits. I realized that I am limited by my src structure (which is out of my control). I am open to any other ideas, if you have any.
thanks.
Alexander HauswaldMemberHi,
in Project Properties->Java Build Path->Source there is a Check Box called: Allow output folders for source folders.
This enables you to set a different output folder for each source folder.
I think, that’s what you’re searching for…bye
Alex -
AuthorPosts