Hi, I am working with eclipse and i made a HelloWorld servlet and it run properly.
I know that when you make a servlet you must configure a web.xml file to map the servlet to a url but
i was searching to find the web.xml in eclipse that maps the servlet url but nothing. Where is it?
There is no "web.xml in Eclipse". The web.xml file is in the J2EE WAR in the WEB-INF directory. Yes, JEE allows it to be be omitted or minimized in a lot of cases, but Eclipse has no inherent J2EE/JEE capabilities to begin with (they're supplied via Eclipse pug-ins), and in any event, a compliant J2EE/JEE app cannot be dependent on an IDE. Just because you develop it using an IDE and test it using an IDE, doesn't mean that the actual webapp is allowed to omit critical WAR elements when the spec demands them.
Customer surveys are for companies who didn't pay proper attention to begin with.
Joined: Oct 18, 2010
thanks a lot.
p.s. indeed, eclipse version is 3.6. i mixed up with netbeans.
Joined: Feb 08, 2006
For some reason I got the same problem here.
I dont have any web.xml file in an EJB project that has a websercive running.
Its actually a problem, because every tutorial for securing web services strives for changes in the web.xml file. And i dont have one.
I know that this is kind of 'other post', but ..
.. how can I secure a webservice (authentication/authorization) without a web.xml file?
This isn't quite the same topic as the original question, so it would have been better to start a new thread. But, since we've raised it from the dead, might as well continue!
JEE (not J2EE) allows the concept of "not having web.xml". Like JSF2, it does this by allowing the default definitions for values to be declared as annotations to the java source code.
Without actually reading the manual I seem to recall that there's an annotation that can allow you to put security controls on certain web resources via annotations, but I don't think that the master controls can be done that way. By "master controls", I mean global things like security transport mechanism selected, whether to use BASIC or form-based authentication and role name definitions. So you probably still need a minimal web.xml file to contain those things.
In J2EE, web.xml is mandatory, since the annotation support didn't exist back then. Note that for legacy EJBs, however, the EJBs had their own config files as well.
Joined: Aug 20, 2012
You will get web.xml file by creating project like this in eclipse:-
File->New->Dynamic Web Project->Next->Next->Generate web.xml deployment descriptor(Select this check box)
then you will find the web.xml file under WebContent/WEB-INF
Joined: Dec 19, 2011
you might be using annotations. if you are using annotations to map the url the entry wont be there in web.xml
Please check on top of servlet. you are finding syntax like