tailieunhanh - Practical Apache Struts2 Web 2.0 Projects retail phần 7

linh hoạt trong hai địa điểm cụ thể: • Trong mẫu , để làm cho một danh sách các nút radio theo chiều dọc bên dưới mỗi khác, hơn là theo chiều ngang bên cạnh mỗi khác • Trong mẫu, để làm cho một danh sách các hộp kiểm tra theo chiều dọc | 196 CHAPTER 7 SECURITY action return Because this is the first interceptor developed there are a few things to point out Most interceptors extend the Abstractinterceptor class and provide an intercept method. If an initialize or destroy method is needed the Interceptor interface can be implemented be wary though interceptors are initialized and destroyed once per web application life cycle not per request like actions . The call invokes the remaining interceptors on the current execution stack until the action is finally invoked. Unless you are short-circuiting the result this method should always be called. The Actioninvocation object contains everything the interceptor needs the action being invoked the ActionProxy configuration information for the action and the ActionContext request session the Value Stack and other environmental and context information . It s really easy to develop interceptors. Because the interceptor was easy to develop with the Actioninvocation object containing everything the interceptor needs to access testing should also be easy. The test case is broken into two parts the first is the test itself and the second is a test action that contains the annotation. Here is the complete test case public class AcegiinterceptorTestCase extends TestCase public void testintercept throws Exception Acegiinterceptor interceptor new Acegiinterceptor TestAction action new TestAction MockActioninvocation ai new MockActioninvocation action SecurityContextimpl sc new SecurityContextimpl Authentication auth new TestingAuthenticationToken new PermissionedUser new User password new GrantedAuthority auth sc CHAPTER 7 SECURITY 197 assertNull ai assertNotNull assertEquals class TestAction private PermissionedUser user public PermissionedUser .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.