Results 1 to 4 of 4
- 04-21-2011, 01:08 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 18
- Rep Power
- 0
How eclipse and Tomcat work together?
I have a problem understanding the concepts of how Eclipse and Tomcat work together.
Let's say I have managed to get Tomcat into servers in my eclipse and its up and running. Now I make a new Dynamic Web Project and make only one servlet in it(no jsp-s, html-s, databases or anything else).
First question: I'm not able to find a web.xml file anywhere on the left pane when i explore my project. Should I create it manually or is it somewhere? Anyway when i run my web project through eclipse it opens an integrated browser window that says Error 404.
Second question: Where does eclipse but the class files and what kind of a structure Eclipse uses?
When I manually make a web app i make folder under web apps and in this folder there will be the web-inf folder and classes folder and so on. When i do a project in eclipse then nothing will apear in tomcat webapps folder. Files all appear in my workspace folder but the structure how they are put there is not like that. And how will Tomcat find the files in my workproject. Is there an extra file somewhere that leads Tomcat to my workspace?
In conclusion i have a real hard time understanding the concept of how Eclipse and Tomcat work together, how much is done automatically and how much do I have to do manually. I havent found a source that would explain all this so that I could understand.
- 04-22-2011, 01:03 PM #2
Member
- Join Date
- Oct 2010
- Posts
- 32
- Rep Power
- 0
hello s3ib,
I've been working with eclipse and tomcat for quite a long time and I find my web.xml in the WEB-INF sub-folder of the WebContent folder.
When you are running your web project through eclipse it'll show Error 404, because in the web.xml file, the welcome files are usually set to some default names like index.html, home.html, etc which is definitely not what you are running!
- 04-26-2011, 10:11 PM #3
Member
- Join Date
- Dec 2010
- Posts
- 18
- Rep Power
- 0
I got it working now and i'm not sure what I did. More precisely i'm not sure what i did wrong before.
Even if i make a windows search in my workspace there is no web.xml file.
But as I can understand(i might be wrong and correct me if I am) i dont really need web.xml when i have correct annotations on my servlets that do the url mapping(for example @WebServlet("/subscriber")). And Eclipse puts those annotations there itself.
Still, thanks for your reply :)
- 04-27-2011, 03:45 AM #4
Member
- Join Date
- Oct 2010
- Posts
- 32
- Rep Power
- 0
hi s3ib,
Good to hear that u got it working now...
You are very correct, but sometimes you may need to change the contents of web.xml manually, like setting the welcome page, that apart sometimes refactoring of servlets doesnot reflect in web.xml, and in those cases you may need to do certain mappings manually. Anyways, keep working...there's a lot u'll learn!But as I can understand(i might be wrong and correct me if I am) i dont really need web.xml when i have correct annotations on my servlets that do the url mapping(for example @WebServlet("/subscriber")). And Eclipse puts those annotations there itself.
Similar Threads
-
Tomcat does not work with my applications
By pjava in forum Java ServletReplies: 0Last Post: 12-31-2010, 12:23 PM -
tomcat & eclipse
By waqar100 in forum EclipseReplies: 2Last Post: 06-26-2010, 02:39 AM -
Eclipse and Tomcat
By kendan in forum EclipseReplies: 4Last Post: 04-03-2009, 01:59 PM -
eclipse with tomcat
By nileshchavan in forum EclipseReplies: 2Last Post: 06-23-2008, 12:25 PM -
Tomcat In Eclipse - Sysdeo Tomcat Plug-in
By JavaForums in forum EclipseReplies: 1Last Post: 02-13-2008, 10:33 AM


LinkBack URL
About LinkBacks

Bookmarks