- This topic has 7 replies, 2 voices, and was last updated 21 years, 2 months ago by support-michael.
-
AuthorPosts
-
palvimMemberHi! Congratulations for such a good product…
I’m trying to migrate from my current IDE (Novell Workbench) to MyEclipse. I need to keep my J2EE projects working in both IDEs so I’m using “link to external folder” in Eclipse.
I could make it work for General Java projects in Eclipse (JARs) but couldn’t use MyEclipse Web Project because it creates its “Web Root” and “Java Source” internal folders and I could reference my own external structure.
My current directory has the following tree:
c:\myproject\src\ (source code package) c:\myproject\Web-inf\ (struts-config.xml, web.xml, etc..) c:\myproject\Web-inf\jsps\ (internals jsps) c:\myproject\Web-inf\lib\ (jars) c:\myproject\midia c:\myproject\build\ (.class, build.xml, etc.)
When I tried to make a Web Project Conversion and define my Web-inf as Web Root Directory and click Finish nothing happened…I had to close the Window with Cancel…
All my jsps aren’t compiling because they aren’t in base path:
Message:
/meus_projetos/jcompany_jcurriculo/WEB-INF/jsps/ajudaSobre.jsp) not in base path (D:/meus_projetos/jcompany_jcurriculo/WEB-INF/Web Folder/) ajudaSobre.jsp jcompany_jcurriculo/WEB-INF/jsps
Any help? Thanks in advance!
support-michaelKeymasterThe issue is that a project web-root folder can not be the project’s output folder. This is because of the Eclipse restriction that does not allow an output folder to contain a src folder. Also is it really legitimate for JSPs to reside under the WEB-INF? I thought this is illegal.
Michael
MyEclipse Support
palvimMemberThanks Michael,
So Web-Root is the same as my “build” directory, rigth? If so, I will have two “web-inf” folders: one inside Web-Root and another external (ie. my actual Web-inf that contains the web.xml, struts-config.xml, tiles-definition.xml, etc….
About the jsps: I think that this approach is the recommended one for MVC2 architecture – my jsps inside Web-inf in order to get the App Server forbidden directly access to them. Since I’m using Struts and MVC2, only my Action classes can reference jsps (the user can’t type their url directly!).
Could you give me a few tips to convert my structure to MyEclipse? What about the window that don’t give me any answer?
Thanks again…
Paulo
support-michaelKeymasterA MyEclipse WebProject requires a web-root folder that serves as the root folder of your webapp. The contents of the web-root folder are laid out exactly like an exploded WAR file structure.
myWebProject/
myWebRoot/
WEB-INF/
classes/
lib/
src/The build folder of a WebProject is always <project>/<web-root>/classes. The MyEclipse deployment facility packages and deploys WebProjects at their <web-root> folder. I have experimented with the use of link files but again by linking the web-root folder back to the project folder results in an output location that overlaps a src folder – a violation of the Eclipse Java project model.
Michael
MyEclipse Support
palvimMemberOk Michael…
I was in a hurry but I’ll try again following the user guide and searching this forum…
Please let me know if there’s some kind of “deeper documentation” about the “deployment” structure or web project organization, ok?…
Regards,
Paulo Alvim
support-michaelKeymasterI’m not sure if you’ve looked at the MyEclipse help that installs with the product. The following URL is a hosted version of the MyEclipse web-project help info.
Michael
MyEclipse Support
palvimMemberHi Michael,
I’m now checking again by following the user guide…
The first point is:
“Web accessible documents such as HTML and JSPs are located under the web root folder and above its WEB-INF folder.”
This isn’t true if you want to protect the JSPs from the Web Clients! If you’re using Struts (or MVC2 patterns) you will probably put your JSPs into Web-inf/jsps/… or something like that because this is the best practic: only the Struts ServletController can find the JSPs (never the client typing the URL!).
So I guess this currently a MyEclipse limitation, isn’t it? I’d like to know if there’s a workaround for my case (I have lots of existing applications that I will have to keep working with others IDE for a while) or if I should open this issue as a feature request….
The second point is:
My typical WAR projects use:
1. Three Other “JAR” project (our generic frameworks)
2. One “resource project” that contains midia, generic jsps, generic css, etc…
We are using Ant to copy – after the build – the 3 “JAR” files to the WEB-INF/lib directory (in the main “WAR” file) and merge the “resource project” directories to the “main” WAR (exploded – not as a JAR!);
I still couldn’t understand if the “hot sync deployment” features will work in this case and how it work together with Ant – maybe I’m missing something here… Could you give me a better idea about that?
Thanks a lot!
support-michaelKeymasterSo I guess this currently a MyEclipse limitation, isn’t it? I’d like to know if there’s a workaround for my case (I have lots of existing applications that I will have to keep working with others IDE for a while) or if I should open this issue as a feature request….
I think the docs might be a little too conservative. You can place your JSPs under WEB-INF without the JSP Editor complaining.
I still couldn’t understand if the “hot sync deployment” features will work in this case and how it work together with Ant
I’m pretty sure your approach will be compatible with the MyEclipse hot-sync mechanism. You run ANT to copy resources into your web project that is deployed in exploded format. Upon the conclusion of your ANT script you either programmatically or manually refresh the <web-root> folder. MyEclipse will identify new, modified, and deleted resources and make the necessary adjustments to the exploded instance(s) of the project to reflect the changes. Eclipse 2.1 provides an Ant task for refreshing a project’s resources (see the Platform Plugin Developer Guide in the Eclipse help system).
Good luck.
Michael
MyEclipse Support -
AuthorPosts