struts2 应用

1.留言本

 

http://www.blogjava.net/rickhunter/category/3664.html

 

2.struts2 spring2 acegi:

 

3.workAction:

<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  <property name="prefix" value="/word/"/> 如果是请求action,自动添加到action的前面.后面增加.jsp
  <property name="suffix" value=".jsp"/>
 </bean>

 

4.http://localhost:8080/spring2-security-struts2/word/viewWord.action
上面的访问会被拦截:因为   <intercept-url pattern="/word/*" access="ROLE_USER" />

在action处理成功后返回的页面:view_word.jsp中有一行代码如下:


<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<sec:authorize ifAllGranted="ROLE_TELLER">
  <s:url action="delete" var="del_word"><s:param name="id" value="id"/></s:url>
  <s:a  href="%{del_word}"><font style="margin-right:12px;">删除</font></s:a></sec:authorize>
  这是acegi的标签:授权给ROLE_TELLER用户delete操作

你可能感兴趣的:(jsp,bean,servlet,Security,Acegi)