in the DD web.xml
if your question is why we have to put a servlet-name which in this case is "servlet1" and then we have to specify the url-pattern too which is "/servlet1" if this is your question the answer is because may be the programmer of the web application don't want to show the exact hirearchy of his web application for security reasons, so he could be mapping his servlet1 to a different url-pattern for example "/registration/registere.do" at this point for the user of the web application it may seem that thehre is actually a directory named registration however this does not exist.
hope i helped you if not please tell me what you meant exactly.
vinoth ar wrote:why we need to have three names for the servlets.... url name, deployement name and file-path name..
thats the beauty of servlet . security purpose
vinoth ar wrote: we can find the particular servlets using file name path right?
what mean by file name path? you mean url-pattern ?...... so what do you think about the way of accessing the servlet?
vinoth ar wrote:why we need to have three names for the servlets.... url name, deployement name and file-path name... we can find the particular servlets using file name path right?
The <servlet-class> roughly imports the servlet class.
The <servlet-name> roughly represents the instance name. E.g. Servlet1 servlet1 = new Servlet1().
The <url-pattern> defines the URL pattern which should invoke this servlet.