Hi Folks,
While programming the
Servlets and using the web.xml, we write the below format:
<servlet>
<servlet-name>xmlServlet</servlet-name>
<servlet-class>main.programs.XMLServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>xmlServlet</servlet-name>
<url-pattern>/XMLServ</url-pattern>
</servlet-mapping>
My question is why can't the below structure be configured to avoid redundancy?
By putting all the required data under one single tag instead of 2 tags ,i.e the <servlet> and <servlet-mapping> tag.
<servlet>
<servlet-name>xmlServlet</servlet-name>
<servlet-class>main.programs.XMLServlet</servlet-class>
<url-pattern>/XMLServ</url-pattern>
</servlet>
By making this kind of lots of redundant code can be reduced.
Please let me know if there is a reason if it cannot be done and correct me if i am wrong in any sense.
Cheers..