Show TOC Start of Content Area

Procedure documentation Redirecting Clients to Other Servers  Locate the document in its SAP Library structure

You can access predefined and self-defined application properties at runtime. You can use the application property LogoffURL to specify the Web address to which the user is redirected after the Web Dynpro application is terminated.

There are three ways of terminating a Web Dynpro application:

      Calling the method: WDClientUser.forceLogoffClientUser(null). This method determines the Web address defined in LogoffURL and redirects the user to this address.The user is automatically logged off. If the application property LogOffURL is not defined, the logoff page predefined by Web Dynpro is displayed.

      Triggering an exit plug from an interface view. When the application is exited using the exit plug, the navigation controlled by the application is called one last time to display a user-defined last page (for example, a single view).

      Executing a redirect when using an exit plug. In this case, the value of the application property LogoffURL must be passed as the parameter Url for the exit plug.

When the Web Dynpro application is terminated by calling an exit plug, the user is not logged off.

The following procedure describes how to terminate the application using an exit plug with a parameter defined for the URL. This procedure is recommended by SAP, because after the termination of a Web Dynpro application the user is not logged off when executing a Web Dynpro application on the NetWeaver Portal.

Prerequisites

You have created the application property LogoffURL in your Web Dynpro project and set a value as described under Setting Values of the Application Properties.

Procedure

       1.      Define an exit plug in the interface view of your Web Dynpro component:

                            a.      Enter a name and check the checkbox Exit Plug.

                            b.      Enter the name Url for the parameter and select string as the type.

Caution

This parameter is case-sensitive and must be entered exactly this way.

       2.      In your view, define the action Exit and add the event handler onActionExit().

       3.      In the view layout, define a button and bind its onAction event to the Exit action.

       4.      In your view, define the use of the interface view controller of your Web Dynpro component under Properties.

       5.      Insert the following code in this method of the implementation:

//@@begin onActionExit(ServerEvent)

String logoffURL = wdComponentAPI.getApplication().getApplicationInfo().findInApplicationProperties("sap.logoffURL").getValue();

wdThis.wdGetTimeCompInterfaceViewController().wdFirePlugExit(logoffURL);

//@@end

Note

When using pre-defined application properties, the name must be passed as the parameter that appears in the Application properties.

Result

The WD application is terminated and the user is redirected to the web page defined in the application property LogoffURL.

End of Content Area