+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++ Administracion.java ++++++++++++++++++++++
+++++++++++
package controladores;
import java.io.IOException;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class Administracion {
@RequestMapping({"index.html"})
public String vista1(Model model) throws IOException {
return "inicio";
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++ inicio.vm ++++++++++++++++++++++++++++++++
+
<html>
<head>
<title>Primer Ejercicio con Spring..</title>
</head>
<body>
<h1>LISTA DE NOTAS</h1>
<table border="1">
<tr>
<th>RU</th>
<th>Nombre</th>
<th>AP</th>
<th>AM</th>
<th>Estado</th>
</tr>
<tr>
<td>aaa </td>
<td>bbb <br></td>
<td>ccc <br></td>
<td>ddd <br></td>
<td>eee <br></td>
</tr>
</table>
</body>
</html>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++ taller1-servlet.xml +++++++++++++++++++++++
++++++++++
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.2.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<aop:aspectj-autoproxy />
<mvc:annotation-driven />
<task:annotation-driven />
<bean id="velocityConfig"
class="org.springframework.web.servlet.view.velocity.VelocityConfigurer"
p:resourceLoaderPath="/" />
<bean id="viewResolver" class=
"org.springframework.web.servlet.view.velocity.VelocityViewResolver"
p:cache="false"
p:viewClass="org.springframework.web.servlet.view.velocity.VelocityView"
p:contentType="text/html;charset=ISO-8859-1" p:prefix="/vistas/"
p:suffix=".vm" />
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />
</beans>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++ web.xml +++++++++++++++++++++++++++++++++
</web-app>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#PARTE II
<bean id="dataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-
method="close"
p:driverClass="org.postgresql.Driver"
p:jdbcUrl="jdbc:postgresql://localhost:5432/mibase"
p:user="postgres"
p:password="123456"
p:minPoolSize="3"
p:maxPoolSize="18000"
p:maxIdleTime="600"
p:acquireIncrement="5"
p:acquireRetryAttempts="5"
p:acquireRetryDelay="60"/>
</beans>
#foreach($reg in $xlista)
<tr>
<td>${reg.ru} </td>
<td>${reg.nombre}</td>
</tr>
#end
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@Autowired
public void setDataSource(DataSource dataSource){
jdbcTemplate = new JdbcTemplate(dataSource);
}
System.out.println("tamanio es::"+lista.size());
model.addAttribute("xlista", lista );
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads