Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dispatcher-servlet.xml and application-context.xml

Tags:

java

spring

  1. Why do we use dispatcher servlet.xml?
  2. Is it something like web.xml?
  3. Is application and dispatcher xmls different from each other, are there any similar things which both can do?
  4. I have a value, now i need to send it to another class? can i do it via application-context.xml
like image 346
theJava Avatar asked Nov 28 '22 15:11

theJava


1 Answers

In addition to Nathans' answer - the dispatcher-servlet.xml defines a child context of the base application context (define in applicationContext.xml)

Child contexts have access to all the beans defined in the parent context, but parents don't have access to beans in the child contexts.

like image 145
Bozho Avatar answered Dec 16 '22 00:12

Bozho