- This topic has 7 replies, 2 voices, and was last updated 19 years, 5 months ago by Riyad Kalla.
-
AuthorPosts
-
GeoffWiggsMemberI have imported a project from a running Tomcat application into Eclipse web-app.
I have given up ever figuring out how to set a specific source directory for the JSP files, everytime I try eclipse wipes out my WEB-INF and META-INF directories and I’m sick of fighting that issue.
However, even worse is the the fact that I I can’t talk Myeclipse into finding the includes on a consistent basis. The IDE will find one include and then not another, even when they are both in the same subdirectory. They all have the .JSPF extension, they are all in the same sub-directory “vrg/WebRoot/includes/xxxxx.jspf”
The error is : cannot be resolved (in file: “includes/header.jspf”)
Any help for either of these?
The HTML validator is off. I’m using eclipse 3.0.2 and MyEcplise 3.8.4+QF2
Riyad KallaMemberGeoff,
Sorry to hear this is not as smooth an operation as it should be. When you create a new Web Project, what are you seeing the WebRoot folder to? Also, where are the JSPs located that have a problem finding the inclues?Ultimately it would be best if you layed out your project structure for me (wrap it in code blocks using the code button below to maintain formatting) so I can see what is going on here.
As a quick point of reference, here is a project layout we usually encourage for best tooling support(not just from ME)
http://www.myeclipseide.com/FAQ+index-myfaq-yes-id_cat-30.html#111
GeoffWiggsMembersupport-rkalla
Thanks for the response. My project file goes like this:
vrg ->.myeclipse ->Java src -->com --->orcas ---->vrg ----->util ->WebRoot -->css -->images -->includes --->*.jspf -->META-INF -->WEB-INF -->*.jps
I finally found a solution to the resolution problem. I moved the page includes above the include statements. Not sure why this was necessary, but not willing to argue. Probably something I don’t know.
But the source file problem still bothers me. I would like to create a source file for my JSPs and my JSPFs above the root level. I have used the ‘Allow output folders for source folders’ option, but when I point to the WebRoot directory, the IDE feels compelled to killing the directory. What’s my work around here?
Also, any idea why my
<%@ page import
statements need to be above my
<%@ page import
need to be in this order?
Thanks
Riyad KallaMemberI moved the page includes above the include statements.
I don’t follow… what do you mean?
Also, any idea why my
Code:
<%@ page importstatements need to be above my
Code:
<%@ page importI think you meant why @page needs to be above <% include right? AFAIK page directives need to come first.
But the source file problem still bothers me. I would like to create a source file for my JSPs and my JSPFs above the root level. I have used the ‘Allow output folders for source folders’ option, but when I point to the WebRoot directory, the IDE feels compelled to killing the directory. What’s my work around here?
For the project structure you gave above, your source dir should be /Java src, your output dir should be /WebRoot/WEB-INF/classes, turn off the “allow blah blah” feature, and your WebRoot directory should be WebRoot
Now given all that, please walk me through exactly the steps you are attempting to do and what is happening and what you would expect to happen. I get the feeling that there is something small here causing the confusion and if you can tell me exactly what you are doing I mgiht be able to clear it up for you.
GeoffWiggsMemberSorry for the poor quality ‘cut and paste’ job. You are right I did mean the @page and <% include.
What does AFAIK stand for?
As to the last portion. Yes, my java bean code is going into my /Java src directory.
Currently I am placing all my JSP code and the “includes” directory under the WebRoot directory. For consistency I would like to be able to remove the code to a JSP src directory directly under the ‘project’ level. I used the ‘allow blah blah” to allow me to specify that the output from that directory should go to WebRoot and that’s when I started loosing the WEB-INF and META-INF directories. Of course, I could just do my changes, etc in the WebRoot directory, but is there a way to remove the working code from that directory without killing everything else?
Riyad KallaMemberWhat does AFAIK stand for?
As far as I know.
SP src directory directly under the ‘project’ level.
I think this is where confusion is comming in… there is no “JSP source directory”, atleast officially. Your JSPs need to be somewhere under your WebRoot directory, anything that is in a “Source directory” will be compiled into your output directory, this is intended to be Java source files, resource files, property files, etc.
to allow me to specify that the output from that directory should go to WebRoot and that’s when I started loosing the WEB-INF and META-INF directories.
Correct, Eclipse *cleans* the output dir before a build every single time, this means if you set your WebRoot as an output dir, Eclipse will erase everything in it before building. This is where the confusion is comming from. Your WebRoot is a mirror of what your deployed project will look like, don’t increase the complexity by trying to place your JSP pages in other places and have it “moved into place”, just place them directly in your webroot where you want them when the projec tis deployed.
Of course, I could just do my changes, etc in the WebRoot directory, but is there a way to remove the working code from that directory without killing everything else?
You *have* to deploy the JSP pages, this isn’t an issue of shipping “source code” or not, your app server has to compile your JSP pages for you at deployment/run time. I think if you start thinking of your JSP pages as HTML pages, it will make more sense that there is no source/binary paradigm, that is a hidden detail that the app server takes care of. Also keep in mind no two app servers will compile the same binary for the same JSP page, so the binary versions of your JSP pages (after being compiled in the app server) are not portable, you can not transfer them between app servers and hope for them to run.
Please take the time to run through working with webapps here: http://www.myeclipseide.com/ContentExpress-display-ceid-67.html
It might help clarify little details that are fuzzy right now.
GeoffWiggsMemberMakes perfect sense. I was still trying to keep the source/binary relationship seperate. The HTML analogy works best, though. So any JSP or JSPF of JSPF “include” directory are simply/coded left in place, correct?
This wraps up the question for me. Please close at your discretion. Thanks a million for your help.
Geoff
Riyad KallaMemberThe HTML analogy works best, though. So any JSP or JSPF of JSPF “include” directory are simply/coded left in place, correct?
Yes exactly.
Thanks a million for your help.
No problem, web dev takes a while to get your brain wrapped around… and as soon as you do, a new framework comes out and you start at 0 again 🙂
-
AuthorPosts