在配置好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">&nbsp;
  <input name="reset" type="reset" value="Clear"></td>
 </tr>
</table>
</div>
</div>
</form>


使用相应的用户名登录后即可有相应的权限,否则重新转到登录页面。

posted on 2008-03-05 15:52 lzj520 阅读(231) 评论(0)  编辑  收藏 所属分类: Spring个人学习日记

只有注册用户登录后才能发表评论。


网站导航: