dataAccessContext-local/jta.xml (see web.xml's "contextConfigLocation"). --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <bean id="pessoaService" class="service.PessoaServiceImp" lazy-init="false" scope="singleton"> <property name="pessoaDAO" ref="pessoaDAO" /> </bean> <bean id="pessoaDAO" class="dao.PessoaDAOImp" init-method="init" lazy-init="false" scope="singleton"> <property name="jdbcTemplate" ref="jdbcTemplate" /> </bean> <!-- arquivo properties --> <context:property-placeholder location="classpath:resources/jdbc.properties" /> <!-- Config. datasource --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}" p:username="${jdbc.username}" p:password="${jdbc.password}" /> <!-- Transaction manager for a single JDBC DataSource (alternative to JTA) --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager" p:dataSource-ref="dataSource"/> <!-- JDBC template --> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" lazy-init="false"> <property name="dataSource" ref="dataSource" /> <property name="lazyInit" value="false" /> </bean> </beans> applicationContext.xml9. Passo: Segue informacoes do banco de dados Derby, que estao contidas em um arquivo de properties. # Properties file with JDBC settings. # # Applied by <context:property-placeholder location="jdbc.properties"/> from # various application context XML files (e.g., "applicationContext-*.xml"). # Targeted at system administrators, to avoid touching the context XML files. #------------------------------------------------------------------------------- jdbc.driverClassName=org.apache.derby.jdbc.EmbeddedDriver jdbc.hostname=localhost jdbc.database=spring jdbc.username=spring jdbc.password=spring jdbc.port=3306 jdbc.url=jdbc\:derby\:directory\:${jdbc.database}ExemploDB;create\=true 10. Passo: Segue as telas jsp. <% response.sendRedirect("./PessoaServlet"); %> index.jsp <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>SPRING</title> <script type="text/javascript"> function validar() { var nome = document.getElementById("nome"); if (nome == null || nome.value == '') { alert("Nome obrigatorio!"); return false; } else { return true; } } </script> </head> <body> <form action="./PessoaServlet" method="get" onsubmit="return validar();"> <table> <tr> <td>Nome:</td> <td><input id="nome" name="nome" type="text"></td> </tr> <tr> <td colspan="2"><input name="acao" type="hidden" value="salvar" /> <input type="submit" value="salvar" /> </td> </tr> </table> <br /> <table> <tr> <td>ID</td> <td>Nome</td> <td>Excluir</td> </tr> <c:forEach var="pessoa" items="${pessoas}"> <tr> <td><c:out value="${pessoa.id}" /></td> <td><c:out value="${pessoa.nome}" /></td> <td><a href="./PessoaServlet?acao=excluir&id=${pessoa.id}">Excluir</a> </td> </tr> </c:forEach> </table> </form> </body> </html> home.jspExemplo da tela:Para quem quiser baixar o projeto desenvolvido, clique aqui.Qualquer duvida, critica ou sugestao, fico a disposicao.