Save This Page
Home » struts-2.1.8.1-src » org.apache » struts2 » rest » [javadoc | source]
org.apache.struts2.rest
public class: RestActionMapper [javadoc | source]
java.lang.Object
   org.apache.struts2.dispatcher.mapper.DefaultActionMapper
      org.apache.struts2.rest.RestActionMapper

All Implemented Interfaces:
    ActionMapper

This Restful action mapper enforces Ruby-On-Rails Rest-style mappings. If the method is not specified (via '!' or 'method:' prefix), the method is "guessed" at using ReST-style conventions that examine the URL and the HTTP method. Special care has been given to ensure this mapper works correctly with the codebehind plugin so that XML configuration is unnecessary.

This mapper supports the following parameters:

The following URL's will invoke its methods:

To simulate the HTTP methods PUT and DELETE, since they aren't supported by HTML, the HTTP parameter "_method" will be used.

Field Summary
protected static final  Logger LOG     
public static final  String HTTP_METHOD_PARAM     
Fields inherited from org.apache.struts2.dispatcher.mapper.DefaultActionMapper:
METHOD_PREFIX,  ACTION_PREFIX,  REDIRECT_PREFIX,  REDIRECT_ACTION_PREFIX,  allowDynamicMethodCalls,  allowSlashesInActionNames,  alwaysSelectFullNamespace,  prefixTrie,  extensions,  container
Constructor:
 public RestActionMapper() 
Method from org.apache.struts2.rest.RestActionMapper Summary:
getIdParameterName,   getMapping,   isDelete,   isGet,   isPost,   isPut,   parseNameAndNamespace,   setDeleteMethodName,   setEditMethodName,   setGetMethodName,   setIdParameterName,   setIndexMethodName,   setNewMethodName,   setPostMethodName,   setPutMethodName
Methods from org.apache.struts2.dispatcher.mapper.DefaultActionMapper:
addParameterAction,   dropExtension,   dropExtension,   getDefaultExtension,   getMapping,   getMappingFromActionName,   getUri,   getUriFromActionMapping,   handleSpecialParameters,   isSlashesInActionNames,   parseActionName,   parseNameAndNamespace,   setAllowDynamicMethodCalls,   setAlwaysSelectFullNamespace,   setContainer,   setExtensions,   setSlashesInActionNames
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.struts2.rest.RestActionMapper Detail:
 public String getIdParameterName() 
 public ActionMapping getMapping(HttpServletRequest request,
    ConfigurationManager configManager) 
 protected boolean isDelete(HttpServletRequest request) 
 protected boolean isGet(HttpServletRequest request) 
 protected boolean isPost(HttpServletRequest request) 
 protected boolean isPut(HttpServletRequest request) 
 protected  void parseNameAndNamespace(String uri,
    ActionMapping mapping,
    ConfigurationManager configManager) 
    Parses the name and namespace from the uri. Uses the configured package namespaces to determine the name and id parameter, to be parsed later.
 public  void setDeleteMethodName(String deleteMethodName) 
 public  void setEditMethodName(String editMethodName) 
 public  void setGetMethodName(String getMethodName) 
 public  void setIdParameterName(String idParameterName) 
 public  void setIndexMethodName(String indexMethodName) 
 public  void setNewMethodName(String newMethodName) 
 public  void setPostMethodName(String postMethodName) 
 public  void setPutMethodName(String putMethodName)