Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

The path to a simple application file is configured via the wink. applicationConfigLocation init-param in the web.xml file. It is possible to specify multiple files by separating them with a semicolon.

Code Block
xml
xml
<servlet>
  <servlet-name>restSdkService</servlet-name>
  <servlet-class>
    org.apache.wink.server.internal.servlet.RestServlet
  </servlet-class>
  <init-param>
    <param-name>wink.applicationConfigLocation<name>applicationConfigLocation</param-name>
    <param-value>/WEB-INF/providers;/WEB-INF/resources</param-value>
  </init-param>
</servlet>

...

Code Block
public class SortingResource<E extends Comparable<? super E>> {
    private List<E> list;
    @POST
    public void sort() {
        Collections.sort(list);
    }
    public void setList(List<E> list) {
        this.list = list;
    }
    public List<E> getList() {
        return list;
    }
}
Explanation

In this the following example, the SortingResource class can sort any list. If the application manages a library of books and exposes the following resource paths, then the SortingResource class can be used for the implementation of all these resource paths, assuming that it could be bound to more than one path.

...

In order to provide a custom properties file, the application should define the wink. propertiesLocation init-param in the Apache Wink Servlet definition.

...