All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.directwebremoting.annotations.package-info Maven / Gradle / Ivy

/**
 * 

Provides annotations support for DWR. This can be used as a replacement as well as * in conjunction with {@code dwr.xml}.

* *

Setup

* *

To use DWR with annotations you need to specify a different DWR controller * servlet in your {@code web.xml}:

* *
 * {@literal }
 *    {@literal }DWR controller servlet{@literal }
 *    {@literal }DWR controller servlet{@literal }
 *    {@literal }{@linkplain org.directwebremoting.servlet.DwrServlet org.directwebremoting.servlet.DwrServlet}{@literal }
 *    {@literal }
 *       {@literal }classes{@literal }
 *       {@literal }
 *          com.example.RemoteFunctions,
 *          com.example.RemoteBean
 *       {@literal }
 *    {@literal }
 * {@literal }
 * 
* *

The {@code classes} servlet parameter must provide a comma-separated list of the * fully-qualified class names of all annotated classes to be used with DWR.

* *

Remote Class Access

* *

To make a simple class available for remote access, use the * {@link org.directwebremoting.annotations.RemoteProxy RemoteProxy} and * {@link org.directwebremoting.annotations.RemoteMethod RemoteMethod} annotations:

* *
 * {@literal @RemoteProxy}
 * public class RemoteFunctions {
 *    {@literal @RemoteMethod}
 *    public int calculateFoo() {
 *      return 42;
 *    }
 * }
 * 
* *

Any method not annotated with {@code RemoteMethod} will not be available * for remote access.

* *

To use a scripting name different from the class name, use the * {@code name} attribute of {@code RemoteProxy}:

* *
 * {@literal @RemoteProxy}(name="Functions")
 * public class RemoteFunctions {
 * }
 * 
* *

Object Conversion

* *

To make simple bean classes available for remote access, use the * {@link org.directwebremoting.annotations.DataTransferObject DataTransferObject} and * {@link org.directwebremoting.annotations.RemoteProperty RemoteProperty} annotations:

* *
 * {@literal @DataTransferObject}
 * public class Foo {
 *    {@literal @RemoteProperty}
 *    private int foo;
 *
 *    public int getFoo() {
 *       return foo;
 *    }
 *
 *    {@literal @RemoteProperty}
 *    public int getBar() {
 *       return foo * 42;
 *    }
 * }
 * 
* *

To use more sophisticated converters see the * {@link org.directwebremoting.annotations.DataTransferObject#converter converter} attribute of the * {@code DataTransferObject} annotation.

* * @author Maik Schreiber <blizzy AT blizzy DOT de> */ package org.directwebremoting.annotations;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy