在配置好acegi的那些filter之類什么的之后,建立index.jsp、login.jsp、order/authorizeOrder.jsp、order/createOrder.jsp文件,按照之前的配置,權限分配是:
/index.jsp=ROLE_ADMIN,ROLE_TECHNICIAN
/order/createOrder.jsp=ROLE_TECHNICIAN
/order/authorizeOrder.jsp=ROLE_ADMIN
/login.jsp=ROLE_ANONYMOUS,ROLE_TECHNICIAN,ROLE_ADMIN
login.jsp的form:
<form action="<c:url value='j_acegi_security_check'/>" method="POST">
<table width=50% border=0 align="center">
<tr>
<td>User:</td>
<td><input type='text' name='j_username'
</td>
</tr>
<tr>
<td>Password:</td>
<td><input type='password' name='j_password'></td>
</tr>
<tr>
<td colspan='2'><input name="submit" type="submit">
<input name="reset" type="reset" value="Clear"></td>
</tr>
</table>
</div>
</div>
</form>
使用相應的用戶名登錄后即可有相應的權限,否則重新轉到登錄頁面。
posted on 2008-03-05 15:52
lzj520 閱讀(247)
評論(0) 編輯 收藏 所屬分類:
Spring 、
個人學習日記