|
Struts example source code file (AnnotationWorkflowInterceptor.java)
The Struts AnnotationWorkflowInterceptor.java source code/* * Copyright 2002-2006,2009 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.opensymphony.xwork2.interceptor.annotations; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.XWorkException; import com.opensymphony.xwork2.interceptor.Interceptor; import com.opensymphony.xwork2.interceptor.PreResultListener; import com.opensymphony.xwork2.util.AnnotationUtils; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; /** * <!-- START SNIPPET: javadoc --> * <p>Invokes any annotated methods on the action. Specifically, it supports the following * annotations: * <ul> * <li> @{@link Before} - will be invoked before the action method. If the returned value is not null, it is * returned as the action result code</li> * <li> @{@link BeforeResult} - will be invoked after the action method but before the result execution * <li> @{@link After} - will be invoked after the action method and result execution * </ul> * </p> * <p/> * <p>There can be multiple methods marked with the same annotations, but the order of their execution * is not guaranteed. However, the annotated methods on the superclass chain are guaranteed to be invoked before the * annotated method in the current class in the case of a {@link Before} annotations and after, if the annotations is * {@link After}.</p> * <!-- END SNIPPET: javadoc --> * <p/> * <pre> * <!-- START SNIPPET: javacode --> * public class BaseAnnotatedAction { * protected String log = ""; * <p/> * @Before * public String baseBefore() { * log = log + "baseBefore-"; * return null; * } * } * <p/> * public class AnnotatedAction extends BaseAnnotatedAction { * @Before * public String before() { * log = log + "before"; * return null; * } * <p/> * public String execute() { * log = log + "-execute"; * return Action.SUCCESS; * } * <p/> * @BeforeResult * public void beforeResult() throws Exception { * log = log +"-beforeResult"; * } * <p/> * @After * public void after() { * log = log + "-after"; * } * } * <!-- END SNIPPET: javacode --> * </pre> * <p/> * <!-- START SNIPPET: example --> * <p>With the interceptor applied and the action executed on Other Struts examples (source code examples)Here is a short list of links related to this Struts AnnotationWorkflowInterceptor.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.