Hello everyone,
Since I have lots of servlet mappings in my web.xml I was wondering if I could actually store all the mappings to separate file and then include it to web.xml.
servervlet-mapping.xml
<servlet>
<servlet-name>red</servlet-name>
<servlet-class>Test.Red</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>red</servlet-name>
<url-pattern>/blue</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>blue</servlet-name>
<servlet-class>Test.Blue</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>blue</servlet-name>
<url-pattern>/blue</url-pattern>
</servlet-mapping>
web.xml
<include file="servlet_mapping.xml"/>
This way it's possible to load xml files in struts.xml. (not sure if the same is possible in web.xml)
Is something like this possible? Or is there any other way to make it work?
(Apologies for my bad english)
Thanks in advance,
Alex
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…