Installation of Sample Application
CourierApp Sample
Follow the steps in this section to locate and install the CourierApp Sample application on WebSphere® Application Server Version 7.0.
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 and Mobile Version 1.0
is unzipped.
- Locating the stand-alone sample:
The CourierApp sample for the RPC adapter library included in the IBM® WebSphere Application Server Feature Pack for Web 2.0 and Mobileis
located in <install_root>/web2mobilefep_1.1/samples/RPCAdapter/CourierApp.war directory when installed for WebSphere Application Server v7.0
. The Helloworld sample is available at <install_root>/web2mobilefep_1.1/samples/RPCAdapter/HelloWorld.ear directory.
Importing the CourierApp sample into an Eclipse-based IDE:
- From the Eclipse IDE menu, select File > Import.
- In the presented panel, expand the Web option, select WAR file, and click Next.
- In the WAR File entry field, click Browse, and select the WAR file you located earlier.
- Ensure the Add Project to an EAR check box is unchecked.
- Accept defaults for the project name, if they are acceptable, and click Next.
- Click Finish. This imports the sample application as a Web project in Eclipse.
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:
- From the Eclipse IDE menu, select File > Import.
- In the presented panel, expand the JavaTM EE option, select EAR file, and click Next.
- In the EAR File entry field, click Browse, and select the EAR file you located earlier. This action populates the other two fields.
- Accept defaults for the project name, if they are acceptable, and click Next.
- Click Finish. This imports the sample application as a Enterprise application project in Eclipse.
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 V7.0
- Start the server and log into the administrative console.
- From the navigation pane, click the New Application link under Applications section
- Select New Enterprise Application.
- Browse your file system and select the CourierApp.war file.
- Select Fast Path option and click Next.
- Keep defaults and click Next (Select installation options).
- Click Next(Map modules to servers).
- Click Next (Map virtual hosts for Web modules).
- In the Map context roots for Web modules page, enter Context Root as CourierApp.
- Click Finish.
- Click Save to the master configuration.
- Click Save.
- Navigate to Applications > Application Types > WebSphere enterprise applications.
- Select the CourierApp_war application and click Start.
- Browse to http://localhost:9080/CourierApp to bring up the welcome page.
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:9080/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
Complete the following steps to implement J2EE security in the CourierApp Sample application on WebSphere Application Server Version 7.0.
Also, complete the following steps to enable security for the sample.
To test Courier application (with security enabled), do the following steps:
- Ensure that administrative security for the server on which the application is deployed is enabled.
- To verify the security is enabled properly, access administrative console and this should prompt for user name and password.
- Log onto the administrative console using a valid user name and password.
- Navigate to Applications > Websphere Enterprise Applications > CourierApp_war > Security role to user/group mapping.
- Select the role and map the users.
- After mapping the users to the roles, click ok.
- Save the configuration.
- Restart server and application.
- The sample with security turned on will provide an authentication screen when the first Web remoting call to the server is made.
A snap shot of the web.xml that shows the url '/RPCAdapter/*' is secured is shown below. To access the methods in this pattern, one has to pass the correct credentials.
BASIC
Sample Security Realm
admin
administrator
Protection area for RPCAdapter Servlet.
/RPCAdapter/*
GET
POST
RPCAdapter Servlet Security:+:All Authenticated users for RPCAdapter Servlet.
admin
NONE
Note: The host name and ports might vary according to your server configuration.