- This topic has 4 replies, 2 voices, and was last updated 20 years, 6 months ago by Riyad Kalla.
-
AuthorPosts
-
Neal TovsenMemberWindows XP Pro
MyEclipse 3.7.200
Eclipse 3.0.0 Build id: 200406251208
JDK version 1.4.2_04-b05
Tomcat 5.0.25
Was Eclipse freshly installed for MyEclipse? Yes.
– Are any other external plugins installed? No
– How many like org.eclipse.pde.*: 8Please bear with me as I try to explain my situation…
My current project is a customization project that involves customizations that are “overlaid” over a “release” WAR in a rather complex Ant build process. Basically, this build process takes a complete WAR from elsewhere on my filesystem (the out-of-the-box web app), overlays my customizations, and then re-packages the new WAR. As such, my actual Eclipse project only contains a few JSP and/or Java classes.
With the Java classes, I have previously been able to avoid compilation errors by adding a linked “classes” folder to my project, which points to a classes directory containing the .class files from the pre-packaged WAR. Until now, I was only working with Java files, so I had not added Web Capabilities on this project.
Now, I wish to create/debug a JSP file. My build script handles deployment, so my only real MyEclipse-related goal here is to be able to debug this file. As-is, it does not associate the compiled class to a JSP file in MyEclipse. It will stop execution of the page, but it cannot associate the running code in Tomcat back to my source JSP file. It would make sense that this is because the project does not have Web Capabilities…is this thinking correct?
But, as you might guess, adding Web Capabilities to the project introduces new issues. My JSPs reference numerous TLD files, CSS, JSPs, etc. that all live in the context of the out-of-the-box WAR file, so I get a mile-long list of “could not load…” in my Problems view. Is there a way to add a reference to these files, similar to adding an entry to the classpath? I really want to avoid adding all these files directly to the project because it would wreak havoc on our CVS process. Also, the size of the out-of-the-box WAR is very large so the validation process takes forever…
Hopefully I’m missing something simple, rather than asking for a massive enhancement request! Please let me know if I haven’t explained my situation clearly enough. I know it’s a bit unorthodox…
TIA!
Neal
Riyad KallaMemberNeal,
Given the complexity of this situation, it would help if we knew the directory structure of some of these important resources so we might be able to pick out “Ohh yea, just include these 2 things on your build path, make a linked resource to here, and copy this file here”. Off the top of my head here, I can see getting the references to the XML files, TLD files and other resources like that being a problem… the classes and JARs are no problem because you just add those via the Java Build Path settings for your project…
Neal TovsenMemberThe application conforms to a standard WAR structure, so of course there is the usual stuff in the project directory:
/WEB-INF
/WEB-INF/classes
/WEB-INF/lib
etc…Almost everything else (JSPs, CSS, lots of XML config docs, etc) is also within the WEB-INF directory. So there are quite a few things like:
/WEB-INF/scripts
/WEB-INF/web
/WEB-INF/stylesheets
etc…The biggest issue (AFAIK) is that the out-of-the-box application is an *overlay* to my project. I could extract a copy of the out-of-the-box project anywhere on the filesystem and link it in, but that would still mess the paths up.
I need to make Eclipse think that the file /WEB-INF/stylesheets/foo.css (in the out-of-the-box WAR, extracted somewhere else) is in the same deployment directory as /WEB-INF/stylesheets/bar.css (in my Eclipse project).
In addition (here’s the real trick), I need to be able to be able to have /WEB-INF/stylesheets/foo.css in my Eclipse project, and it must override /WEB-INF/stylesheets/foo.css in the out-of-the-box WAR.
So I guess it really is the same paradigm as a classpath for non-.class resources.
Can a web project be dependent on another web project? I could set up the out-of-the-box WAR as a separate Eclipse project, and make my project dependent on it. That would conceptually make sense…but I’ve only ever thought about making Web projects dependent on Java projects before…
Neal
(PS: Except for this issue, I am really liking this “SDK” sort of setup. Not applicable for most custom web apps, but it works really well for a “shrink-wrapped” or commercial sort of web app that is likely to be sold and then customized for numerous different customers. It makes managing future upgrades and customizations MUCH less painful. All you have to do is “install” the new out-of-the-box WAR, fix any regression- or compatability-type bugs in your customized code base, and re-deploy. Very elegant…except for JSP debugging, it seems. :evil:)
Neal TovsenMemberOK…this is wierd.
I created two new test web projects to try the dependent-project thing. They’re called baseweb and overlayweb. The overlay doesn’t seem to work, in that overlayweb doesn’t seem to “see” resources in the base project.
But it isn’t complaining about it either. 😕
I wrote a test JSP page in overlayweb. If I <jsp:include> a .jsp/.jspf file that is either in the baseweb (or one that doesn’t even exist at all), I don’t get any errors in the Problems window. Tomcat doesn’t even complain when I deploy overlayweb…it just ignores the tag and displays the rest of the page like everything is normal. Even debugging just steps right through that line without hesitation.
Is there some setting that may be different between this new project and my original one? The original one complains about all the missing <jsp:include> references, error page references, etc…
Neal
Riyad KallaMemberNeal,
This seems to be a pretty complex system of mixing and matching, so I’ll help where I can but ultimately I think this is going to boil down to you “playing around with stuff like crazy” :), also NTFS supports symlinks like Unix, so you might be able to play some tricks there (google for “NTFS links” or something like that, we address it here in the forums as well).A few suggestions:
The key to the depenednt projec thing working is to make sure they are deployed correctly. You might want to try fidgeting with the Project Properties > Myeclipse-Web deployment settings. Also you could try making use of linked resources in Eclipse, or even symbolic links from NTFS to make your ‘overlay’ project think it sees stuff that isn’t really there… -
AuthorPosts