001/* 002 * Copyright 2002-2015 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.web.portlet.bind.annotation; 018 019import java.lang.annotation.Documented; 020import java.lang.annotation.ElementType; 021import java.lang.annotation.Retention; 022import java.lang.annotation.RetentionPolicy; 023import java.lang.annotation.Target; 024 025import org.springframework.core.annotation.AliasFor; 026import org.springframework.web.bind.annotation.Mapping; 027 028/** 029 * Annotation for mapping Portlet action requests onto handler methods. 030 * 031 * @author Juergen Hoeller 032 * @author Sam Brannen 033 * @since 3.0 034 * @see org.springframework.web.bind.annotation.RequestMapping 035 */ 036@Target(ElementType.METHOD) 037@Retention(RetentionPolicy.RUNTIME) 038@Documented 039@Mapping 040public @interface ActionMapping { 041 042 /** 043 * Alias for {@link #name}. 044 */ 045 @AliasFor("name") 046 String value() default ""; 047 048 /** 049 * The name of the action, according to the Portlet 2.0 050 * {@code javax.portlet.action} parameter. 051 * <p>If not specified, the annotated method will be used as a default 052 * handler: i.e. for action requests where no specific action mapping 053 * was found. 054 * <p>Note that all such annotated action methods only apply within the 055 * {@code @RequestMapping} constraints of the containing handler class. 056 * @since 4.2 057 * @see javax.portlet.ActionRequest#ACTION_NAME 058 * @see #value 059 */ 060 @AliasFor("value") 061 String name() default ""; 062 063 /** 064 * The parameters of the mapped request, narrowing the primary mapping. 065 * <p>Same format for any environment: a sequence of {@code "myParam=myValue"} 066 * style expressions, with a request only mapped if each such parameter is found 067 * to have the given value. {@code "myParam"} style expressions are also supported, 068 * with such parameters having to be present in the request (allowed to have 069 * any value). Finally, {@code "!myParam"} style expressions indicate that the 070 * specified parameter is <i>not</i> supposed to be present in the request. 071 * @see org.springframework.web.bind.annotation.RequestMapping#params() 072 */ 073 String[] params() default {}; 074 075}