Probably this is trivial stuff.... But my last Web project is years ago and I have some troubles starting up again.
I am working on a tutorial site using Eclipse (Helios). I started the project as a JAva project. Ths Eclipse installation appears to be Web-unaware, there is no option to start a Web project.
I remember the right structure of the Web application, using a WEB-INF dir with the web.xml directory. I think the project should be made Web-aware and creating the right structyre manually should not be necessary...
Should I move the whole project to the Tomcat webapps dir and create the WEB-INF manually or is there an Eclipse plugin available to make my project WEb-aware package it into a WAR file and deploy it to the Tomcat container?
Most tutorials on this subjext appear to be pretty outdated so any advice is welcome!
"What you don't know, can't help you"
SCJP (81%), SCWCD (81%), SCJD (354/400), SCBCD (85%)
Thanks Peter, I did that
One more issue, I also have to copy the libraries, or better, attach them to the new Web-project.
It appears that there are 2 different lib directories in the web project structure:
Java Resources - Libraries
WEB-INF - lib
I know that libraries that are deployed with the WAR file must be placed under WEB-INF/lib
But what is the point of those 2 different folders?
It appears that, if I add an external JAR file in the normal way via Project Proerties - Java Build PAth, it becomes visible under JAva Resources - Libraries.
And one final question, what is the best location for configuration files as the hibernate.cfg.xml file?
This is a guess, but I imagine that you would want to place any JAR files that you want to deploy with the WAR into the WEB-INF/lib directory, and any JARs you need to compile with but you don't want packaged with the WAR (such as the servlet.jar) should be placed into the Java Build Path (they will show up under Java Resource - Libraries).
Why a guess? I always use either Ant or Maven for my builds so I am usually only concerned with the proper JARs being in the Java BUild Path, and with m2eclipse I don't even worry about that since m2eclipse makes declaring dependencies easy and automatically handles the needs of both Eclipse and the Maven build.