Installation of Sample Application

CourierApp Sample

Follow the steps in this section to locate and install the CourierApp Sample application on WebSphere® Application Server Community Edition Version 2.x . If <install_root> is the directory where the feature pack is installed in the case of WebSphere Application Server (for example, the directory where WebSphere Application Server is installed) and <WASCEFEP_HOME> is the directory where IBM WebSphere Application Server Community Edition Version 2.0 Plug-in for Web 2.0 Version 1.0 is unzipped.

Importing the CourierApp sample into an Eclipse-based IDE:

When the import process completes, a new project exists in the Eclipse Project Explorer: CourierApp from which the application source code can be accessed.

Importing the HelloWorld sample into an Eclipse-based IDE:

When the import process completes, three new projects exist in the Eclipse Project Explorer: HelloWorldEJB, HelloWorldWAR and HelloWorld. The application source code can be accessed from the HelloWorldEJB project.

Installing the sample on WebSphere Application Server Community Edition 2.x:

Note: The host name and ports might vary according to your server configuration.

HelloWorld Sample

The steps to install HelloWorld sample application is same as CourierApp. Follow the instructions previously mentioned to install and deploy the application. There is no need for the specification of a context root in this case.Browse to http://localhost:8080/helloworld to bring up welcome page of sample. The Context root is helloworld.

Note: The host name and ports might vary according to your server configuration.

Securing the CourierApp Sample application

Follow the steps in this section to to implement J2EE security in the CourierApp Sample application on IBM WebSphere Application Server Community Edition 2.x. Also, follow the steps to enable security for the sample.

If access is granted to a role other than one that is authenticated in the previous step, RPC adapter denies access to the corresponding service and return an "Invalid Access" error. In the examples shown ahead, only the "non-Admin" role has access to the DestinationLookup service. If the user has not been authenticated or has been authenticated in a different role, then access to this service is denied by the RPC adapter.
<pojo> <name>DestinationLookup</name> <role>non-Admin</role> <!-- optional --> <implementation>com.ibm.courier.DestinationLookup</implementation> <methods filter="whitelisting"> <method> <name>getDestination</name> <description>get destination</description> <http-method>GET</http-method> <parameters> <parameter> <name>destinationId</name> </parameter> </parameters> </method> </methods> </pojo>

A snap shot of the geronimo-web.xml file that defines the "admin" role is shown below.

<security-realm-name>geronimo-admin</security-realm-name> <security> <role-mappings> <role role-name="admin"> <principal name="admin" class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"/> <principal name="system" class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"/> </role> </role-mappings> </security>

Note: The host name and ports might vary according to your server configuration.