|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IERXRouteComponent
If you return a component from ERXRouteController that implements the IERXRouteComponent interface, the route controller will attempt to find set-methods on your component that correspond to the current route keys. For instance, if you have a {person:Person} in your route, ERXRouteController will attempt to call setPerson(Person) on your component as long as the setPerson method has a @ERXRouteParameter annotation.
The system will look for a String variant of the method first (to avoid faulting if you don't want to trigger a fault). If a String method is not found, it will look for the typed version, which will trigger a fault of the object if the method is found.
Exampleroute (super-contrived): /person/{person:Person}/company/{company:Company}/task/{task:Task}
public class TasksController extends ERXRouteController { public WOActionResults viewAction() { if (format() == ERXRestFormat.HTML) { return pageWithName(TaskComponent.class); } return response(...); } }
public class TaskComponent extends ERXComponent implements IERXRouteComponent { @ERXRouteParameter public void setCompany(String companyID) { ... } @ERXRouteParameter public void setTask(Task task) { ... } public void setPerson(Person person) { ... } }
In the above example, setCompany will be called, passing in the company ID from the URL. setTask will be called, passing in the actual Task object, and setPerson will NOT be called because it is not annotated @ERXRouteParameter
Method Summary |
---|
Methods inherited from interface com.webobjects.appserver.WOActionResults |
---|
generateResponse |
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |