spring


spring mvc context behavior


i m using spring MVC . My web.xml is this:
<?xml version="1.0" encoding="UTF-8"?>
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<!-- The definition of the Root Spring Container shared by all Servlets and Filters -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
<!-- Creates the Spring Container shared by all Servlets and Filters -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Processes application requests -->
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
root context:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- Root Context: defines shared resources visible to all other web components -->
</beans>
servlet context:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- DispatcherServlet Context: defines this servlet's request-processing
infrastructure -->
<!-- Enables the Spring MVC #Controller programming model -->
<annotation-driven />
<!-- Resolves views selected for rendering by #Controllers to .jsp resources
in the /WEB-INF/views directory -->
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
<context:component-scan base-package="org.springframework.rest" />
</beans:beans>
I have some question: with these configuration i have 1 container with inside the beans configured with root-context and servlet-context ? In simple words root-context and servlet-context shared the same container ? Can i have more context ?
Thank
Esoni

Related Links

Error creating bean with name 'scopedTarget.org.springframework.batch.repeat.policy.SimpleCompletionPolicy#0'
Multiple Schema in Spring Hibernate application
How to get the values of a select multiple?
Unable to get field from form
Spring ModelAndView Attribute is null
How to persist download count in Grails
How to execute ANY() SQL in Spring jdbcTemplate?
Wildfly 10 no logs after spring-boot-starter-logging exclusion
Issue with CORS in firforx and spring security
JdbcTemplate - Insert or update Oracle BLOB using SQL MERGE
Debug Jackson with Spring
Post method not working with abstract class in Spring
trigger Context refresh from rest API spring-boot error
REST Client Grails Groovy unable to resolve class RestClientBuilder
ServletRegistrationBean cannot be resolved in SpringBoot
Spring Bean injection fails on OpenShift

Categories

HOME
caching
security
xamarin.android
wsdl
textwatcher
agile
amazon-product-api
windows-store-apps
browserify
jframe
criteria
outlook-web-addins
game-physics
cross-platform
r-lavaan
grub2
jcl
scalaz7
rworldmap
tfs2013
compare-and-swap
i3
reactiveui
spring-profiles
spring-insight
fractals
getline
division
lego
brute-force
onbackpressed
php-ews
estimation
ajp
azure-availability-set
mouseclick-event
android-bitmap
qos
iron.io
sql-import-wizard
cjson
c#-interactive
mailcatcher
project-online
django-south
fortran90
asymptote
site-prism
futuretask
sevenzipsharp
wif
integral
vine
twitter-rest-api
ibm-data-studio
lines-of-code
isml
google-earth-plugin
ejabberd-saas
belongs-to
errorprovider
vcl
dto
eclipse-classpath
alpha-transparency
planetary.js
picat
openkinect
visual-c++-2010-express
vmware-server
qt4.6
template-haskell
pys60
pitch
xgettext
cadisplaylink
macruby
legacy-code
nemerle
newsstand-kit
curljs
testunit
phpcrawl
ihttphandler
for-xml-path
zend-form-element
mvccontrib-grid
yajl
unreachable-code
external-assemblies

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App