I am confused with arrangement in the declaration Elements. Is there any difference if I write like this:
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/web-application-context.xml
</param-value>
</context-param>
Or like this?
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/web-application-context.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
Yes and no:
yes – the order of some elements like
<filter-mapping/>is relevant, as it will change the order of actual filters being applied. Also the schema forweb.xmldefines the order of various elements.no – the order of other elements is irrelevant, e.g. the order in which you declare
<servlet/>s. Also in your example it doesn’t make any difference.