- This topic has 21 replies, 8 voices, and was last updated 18 years ago by Craig Peters.
-
AuthorPosts
-
dafortinMemberI have (what I hope is) a simple question.
How can I configure multiple web projects to share JSP files?
I see how I can use dependant Java projects to share source code and that works great. I’d like the same type of mechanism to share JSP files. I have a lot of “boiler-plate” JSPs (login, logout, validation, etc) that need to be the same in several Web Projects. At this time, the only mechanism I can find is to make phytsical copies of the JSP files and place them in each project. This make maintenance quite a pain in the %^$ since changes need to be replicated. Not the most time or effort efficient method (and, of course, very error prone).Please tell me there is a simple way to share JSPs like I can share java files.
Thanks
Riyad KallaMemberHow can I configure multiple web projects to share JSP files?
You can’t do this easily. You can fake this via sym links and such, but “official” IDE support for this (outside of linked folders) is not supported. And even linked folders do not work all that well because they are only allowed at the root level.
dafortinMemberOK, so the IDE doesn’t support it. Now I have another simple question.
WHY?
Isn’t this identical to sharing source files?
When I have a dependant Jave project, the tool correctly handles and
deploys the referenced source. Why not also allow dependant Web Projects and handle it identically? At least conceptually, it looks like the same
thing to me. And it is a very common issue – sharing code (Java, HTML, JSP, whatever).
Riyad KallaMemberIsn’t this identical to sharing source files?
No, there are very clear guidelines to how classes in a source tree are organized and packaged, this makes combining source trees trivial. With web projects there is no criteria for the organization of the JSP pages or the resource files. If you have two Web Projects dependent on eachother, which web.xml file do you use when they are combined? Which struts-config.xml? How about the libs? What if they are different versions? What about 2 JSP files with the same name, but diferent sizes and/or timestamps?
If we even tried to broach this functionality these are all issues and options we would need to implement as every user would have a different setup and expect different things. And it would really just be fumbling around in the dark since there is no spec to define how this is to be done. This is why we have historically stayed away from this… it is certainly dooable, that’s not what I’m getting at… just why we haven’t spent a ton of time doing it, to find out 10-20 people use it out of 10s of thousands.
dafortinMemberI see. Thanks for the considered reply. I fear that I have not expressed my
request quite correctly, however. If you don;t mind, I’d like to try to clarify it.
Since MyEclipse creates a specific directory structure when a Web Project is created,
I had hoped that a simple path-to-path mapping would work. I was not implying that
the “secondary” web-project would actually be fully functional, only that the directory
structure would be similar to allow those shared pieces to, in fact, be shared.
The “secondary” web-project would be a partial project, containing only those
files to be shared among other web-projects. Thereby allowing me to maintain a
single copy of such shared code, rather than having to make and maintain numerous
copies. This is what I meant by “identical to sharing code.” The directory structure
implies exactly where to place the shared pieces.
Riyad KallaMemberI haven’t forgotten about you, I have just been thinking about this and am asking some devs to look at it and see if it is something we would want to add to our mile-long todo list or if it is just too corner-case for us to address *right now*.
Riyad KallaMemberOk after talking with some devs this type of idea will likely be supported in 5.0 (late August-ish timeframe) as we are totally revamping our project structure to be totally flexible. I hope that is semi-good news?
George DinwiddieMemberI just wanted to put in another vote for this. I’m currently plugging for the use of MyEclipse at my current contract, and they already have this sort of dependency between web projects. The fact that MyEclipse cannot reference JSPs and Tag Libraries from another project reduces its usefulness quite a bit.
Riyad KallaMemberGuys, what alternative IDEs that you have used *can* do this? This helps us get an idea of what types of implementation our users may be used to.
George DinwiddieMemberI don’t know what IDEs can do this; I haven’t used one. But I can do it, and rather easily, when building with ant.
Consider this:
When I go into project properties | Java Build Path and choose the Projects tab, I can specify projects on which this project depends. The java source code for the checked projects are, in effect, included in this project.
It would be nice to have a similar functionality for including the JSPs, JSP fragments and tag libraries from the web-root of a project on which this one depends.
As I said, I do not know of an IDE which currently provides this. If you know of one, I would be glad to check it out. Or, if you can suggest another way of working when you have JSPs and tag libraries that are common to multiple projects developed by the same team, I’m all ears. What I don’t want to do (and have been actively eliminating) is duplicating the common elements in all of the projects. There have been serious issues with mismatched versions when duplication was present.
– George
http://www.idiacomputing.com
Riyad KallaMemberGeorge,
The only way I can think of doing this is by way of sym links at the filesystem level (yes NTFS supports them, might need to google for it or check our forums, posted about a year and a half ago).This is a very real working environment we realize, we just don’t have a solution in place yet.
crazyyoyoMember@support-rkalla wrote:
Ok after talking with some devs this type of idea will likely be supported in 5.0 (late August-ish timeframe) as we are totally revamping our project structure to be totally flexible. I hope that is semi-good news?
Hi,
Is this feature still planned for 5.0?
I do not want to rely on sym links for the project to work.
Scott AndersonParticipantYes, it’s still on the feature enhancement list for 5.0 right now. It’s a nice idea, just not something we’ve had time to work on yet. 🙂
crazyyoyoMemberExcellent!
Thanks
gdinwiddie.wellsfargoMember@support-scott wrote:
Yes, it’s still on the feature enhancement list for 5.0 right now. It’s a nice idea, just not something we’ve had time to work on yet. 🙂
I’m downloading 5.0 right now. I’ve had this issue in my bookmarks, and I was wondering if this feature was included in 5.0.
– George
http://www.idiacomputing.com/ -
AuthorPosts