import org
import org
import org
public class TestServlet extends HttpServlet
{
private static final long serialVersionUID =
public void doGet(HttpServletRequest request
throws ServletException
{
response
PrintWriter out = response
ApplicationContext ctx =
WebApplicationContextUtils
TestAcegi test = (TestAcegi)ctx
test
out
}
public void doPost(HttpServletRequest request
throws ServletException
{
doGet(request
}
}
准備工作做好了
先在Spring裡給Acegi做個代理
<property name=
<list>
<value>testAcegi</value><!
</list>
</property>
<property name=
<list>
<value>methodSecurityInterceptor</value><!
</list>
</property>
</bean>
裡面的methodSecurityInterceptor呢配置為
<property name=
<ref bean=
</property>
<property name=
<ref bean=
</property>
<property name=
<value>org
</property>
</bean>
[
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28996.html