Announcement Announcement Module
No announcement yet.
new xml tags <beans:bean > etc - Im confused Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • new xml tags <beans:bean > etc - Im confused

    Hi ,

    I generated a Spring MVC web app from STS.

    I see that the xml files use a whole bunch of new tags i.e. <beans:bean .. etc

    Do I have to use these? can I mix with old ones ? whats the advantages? I just got the latest Spring in Action and theres no mention of these new xml namespaces

    see below

    hope you can help

    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans xmlns=""

    <!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->

    <!-- Enables the Spring MVC @Controller programming model -->
    <annotation-driven />

    <!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
    <resources mapping="/resources/**" location="/resources/" />

    <!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
    <beans:bean class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
    <beansroperty name="prefix" value="/WEB-INF/views/" />
    <beansroperty name="suffix" value=".jsp" />

    <!-- Imports user-defined @Controller beans that process client requests -->
    <beans:import resource="controllers.xml" />


  • #2
    I suggest a read on xml namespaces... There are no new namespace which namespace is the root depends on how you configure your xml and xml namespace. For your xml the mvc namespace is the root, thus for all other namespaces you have to prefix them including the beans one.