Show TOC Start of Content Area

Procedure documentation Declaring and Configuring Web Components  Locate the document in its SAP Library structure

Use

You can declare the Web components classes in the web.xml deployment descriptor to determine the order in which they are loaded, and the name the component is referred to in the context of the Web application. You can also configure:

·        Display information – this is used when the Web components are visualized by a GUI-based tool.

·        Initialization parameters – these affect the initialization of the corresponding Web component.

The following settings can be configured only for servlets or JSP pages:

·        The load time and the loading order – determines whether the servlet classes are loaded on application startup.

·        Security role references and run-as identity – maps the components to existing security roles on the J2EE Engine.

Note

The above configurations do not apply to listeners. Only the fully qualified name of the listener class is declared in the web.xml. Practically, you do not have to explicitly declare the listener class name because the SAP NetWeaver Developer Studio automatically does this when you add the corresponding listener to your Web Module project.

Procedure

On the web.xml screen, proceed as follows:

...

       1.      Open the Web Objects screen.

       2.      Choose the component that you want to declare and configure from the list so that the corresponding configuration fields are displayed on the screen.

Note

When you complete this step, you see that the Name and Source fields (Filter Name and Filter Class in case of a filter) are already completed. The SAP NetWeaver does this for your convenience when you add the corresponding components to your Web Application project.

       3.      To configure your Web components further, you can do each of the following:

Configuration Option

Procedure

Specifying initialization parameters.

...

       1.      Choose Add from the Init Parameters pane. This adds an empty Name-Value pair to the table of initialization parameters.

       2.      Enter the name and the value of the initialization parameter in the fields under the Name and Value columns, respectively. You can optionally provide description of the parameter in the Description field.

The initialization parameters that you specify are used when the component is initialized as described in Initializing Servlets and Initializing Filters.

Configuring the display information.

...

Proceed as follows on the Information pane:

       1.      Enter a name in the Display Name field. It is used by the GUI tools to display that component.

       2.      If you want to use an icon when displaying the component by the GUI tool, select Icon and specify the location of the image files to be displayed as icons.

       3.      Optionally, give any relevant description in the Description field.

Determining the load order.

Enter an integer number in the load on startup field. Servlets with lower load-on-startup values are loaded before those with higher values.

Configuring the run-as identity of servlet or JSP components.

...

You can associate your component with an already defined server security role in order to determine the security privileges it has within the Web application. This enables users that are not authenticated for the Web Container to make calls to enterprise beans components. To do this, you must first define security roles as described in Defining Web Applications Security Roles. Then proceed as follows:

       1.      Select run-as to activate the role-name and Run-As Description fields.

       2.      To add the security role with which the identity of the component is associated, choose Add. This adds it to the role-name field.

       3.      Optionally, provide a description of this role in the Run-As Description field.

Defining Security Role References.

...

You can specify a reference between the security role name that you used in your servlet (or JSP) code and a security role that you have defined for your Web application. To be able to set such a reference, you must have defined the corresponding security roles as described in Defining Web Applications Security Roles. Then proceed as follows:

       1.      Choose Add from the Security Role References pane.

       2.      Choose the existing server security role to map to from the Choose security role screen that appears.

Note

This screen contains the list of security roles as defined in the Security Roles screen. The chosen role appears as a value of the Link field in the list of security roles references.

       3.      Select the corresponding row from the list of security roles references and enter the role name that you used in your code in the Name field. This name must be the same as the string that you provided as parameter to the isUserInRole(String role) method.

       4.      Optionally, enter a description of the reference that you define in the Description field.

 

End of Content Area