-
Nov 9th, 2010, 02:09 AM
#1
DispatcherServlet vs ContextLoaderListener?
Dear All,
In spring mvc,i have defined in web.xml DispatcherServlet and ContextLoaderListener.
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/xxxxxxx-servlet.xml
</param-value>
</context-param>
----------------------------------
<servlet>
<servlet-name>xxxxxxx</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
---------------------------------------
How many Instances are created during the start up in container (service,dao,handler)?
-
Nov 9th, 2010, 02:48 AM
#2
Please use code tags when posting code.
You have misconfigured your app. Your ContextLoaderListener must not load the servlet context, if you do this you will effectivly have 2 instances of everything.
-
Nov 9th, 2010, 03:47 AM
#3
Thanks..marten..
I have very basic question. I understood in third party frameworks(i.example : DWR,struts,JSF,etcccc) are defining in ContextLoaderListener only. But in spring MVC how to define in web.xml? Is it necessary to use both configurations? If i am doing both how can I avoid 2 instance creation in spring mvc?
Is it possible to configure third part framework (I.example : DWR,STRUTS,JSF…etcc)in dispatcher servlet file? i mean without ContextLoaderListener.
Thanks,
selva
Last edited by selvapa; Nov 9th, 2010 at 05:50 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules