Generate URLs to model actions

 

+

Search Tips   |   Advanced Search

 

You can generate the URL for actions in the current model or in another model.

Call the getActionURL() or getURLMapper().getURL() method on the webAppAccess object.

To generate the URL for an action in the current model:

The following method call returns the URL for the actionName method in the current model:

webAppAccess.getActionURL("actionName");

The returned URL string has the form:

/appcontext/servletname/models/path/to/models/Action!actionName
For example:

/MyApp/webengine/test/TestModel/Action!getCustomers

To generate the URL for another model:

The following method call returns the URL for the GetCustomers action in the ModelName model with the Northeast and Gold profiles explicitly applied to the model:

webAppAccess.getURLMapper().getURL("ModelName", "GetCustomers", "Region!Northeast$ServiceLevel!Gold", null);

Note: The last argument to the getURL() method is the transport protocol. You can also specify http or https to force the protocol type or you can specify null to use the default protocol for the model.

The returned URL string has a form similar to the one returned from getActionURL() except that it includes the specified profile information as shown below:

/MyApp/webengine/method/MethodTest2/Action!main/Profile!Region!Northeast$ServiceLevel!Gold

Parent topic: Overview: working with Java


Library | Support |