Enhance sample to show method authorization.
This commit is contained in:
20
samples/tutorial/src/main/webapp/WEB-INF/bank-servlet.xml
Normal file
20
samples/tutorial/src/main/webapp/WEB-INF/bank-servlet.xml
Normal 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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user