Learn Java for Web Development

(Tina Meador) #1
CHAPTER 6: Component-Based Web Development Using JSF 2 293

Listing 6-21. applicationContext.xml



  1. <?xml version="1.0" encoding="UTF-8"?>

  2. <beans xmlns="http://www.springframework.org/schema/beans"

  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"

  4. xmlns:aop="http://www.springframework.org/schema/aop"

  5. xsi:schemaLocation="http://www.springframework.org/schema/beans

  6. http://www.springframework.org/schema/beans/spring-beans-3.2.xsd

  7. http://www.springframework.org/schema/context

  8. http://www.springframework.org/schema/context/spring-context-3.2.xsd

  9. http://www.springframework.org/schema/aop

  10. http://www.springframework.org/schema/aop/spring-aop-3.2.xsd">


























































  11. <bean id="dataSourceBean"

  12. class="org.springframework.jdbc.datasource.DriverManagerDataSource">




















   Lines 18 to 20: Configures bookController with bookService

Developing Templates

You will reuse the template and the template client file developed earlier for the header and
sidebar of the bookstore application. However, you need to modify sideBar.xhtml to invoke the
listOfAllBooks action in the bookController bean, as illustrated in Listing 6-22.

Free download pdf