Enhance sample to show method authorization.

This commit is contained in:
Ben Alex
2007-12-14 02:27:48 +00:00
parent 77d286c36f
commit f4c3e701d5
11 changed files with 300 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean name="/listAccounts.html" class="bigbank.web.ListAccounts">
<constructor-arg ref="bankService"/>
</bean>
<bean name="/post.html" class="bigbank.web.PostAccounts">
<constructor-arg ref="bankService"/>
</bean>
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
</beans>

View File

@@ -0,0 +1,27 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<h1>Accounts</h1>
<a href="index.jsp">Home3</a><br><br>
<table>
<c:forEach var="account" items="${accounts}">
<tr>
<td>
<c:out value="${account.id}"/>
</td>
<td>
<c:out value="${account.holder}"/>
</td>
<td>
<c:out value="${account.balance}"/>
</td>
<td>
<a href="post.html?id=<c:out value="${account.id}"/>&amount=-20.00">-$20</a>
<a href="post.html?id=<c:out value="${account.id}"/>&amount=-5.00">-$5</a>
<a href="post.html?id=<c:out value="${account.id}"/>&amount=5.00">+$5</a>
<a href="post.html?id=<c:out value="${account.id}"/>&amount=20.00">+$20</a>
</td>
</tr>
</c:forEach>
</table>