Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.dispatcher.mapper
Class RestfulActionMapper

    java.lang.Object
      org.apache.struts2.dispatcher.mapper.RestfulActionMapper

All Implemented Interfaces:
  ActionMapper

    public class RestfulActionMapper

extends Object
implements ActionMapper

A custom action mapper using the following format:

`http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2`

You can have as many parameters you'd like to use. Alternatively the URL can be shortened to the following:

`http://HOST/ACTION_NAME/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2`

This is the same as:

`http://HOST/ACTION_NAME/ACTION_NAME + "Id"/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2`

Suppose for example we would like to display some articles by id at using the following URL sheme:

`http://HOST/article/Id`

Your action just needs a setArticleId() method, and requests such as /article/1, /article/2, etc will all map to that URL pattern.

Field Summary
`protected static Log` | `LOG`

Constructor Summary
`RestfulActionMapper()`

Method Summary
`ActionMapping` | `getMapping(HttpServletRequest request, ConfigurationManager configManager)` Expose the ActionMapping for the current request
`String` | `getUriFromActionMapping(ActionMapping mapping)` Convert an ActionMapping into a URI string

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### LOG

    protected static final Log LOG

Constructor Detail

### RestfulActionMapper

    public RestfulActionMapper()

Method Detail

### getMapping

    public ActionMapping getMapping(HttpServletRequest request,
                                    ConfigurationManager configManager)

  Description copied from interface: `ActionMapper`
  Expose the ActionMapping for the current request

  Specified by:
    `getMapping` in interface `ActionMapper`
  Parameters:
    `request` - The servlet request
    `configManager` - The current configuration manager
  Returns:
    The appropriate action mapping

### getUriFromActionMapping

    public String getUriFromActionMapping(ActionMapping mapping)

  Description copied from interface: `ActionMapper`
  Convert an ActionMapping into a URI string

  Specified by:
    `getUriFromActionMapping` in interface `ActionMapper`
  Parameters:
    `mapping` - The action mapping
  Returns:
    The URI string that represents this mapping

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.