|
|
| WebLogic Server 6.1 Code Examples, BEA Systems, Inc. |
Package examples.wireless.helloWorld
This simple example illustrates connectivity between WebLogic Server and a mobile terminal (examples: cell phone, PDA, pager, etc.)using a framework to implement the traditional "Hello World" application.
See:
Description
|
HelloWorld Example Summary |
| HelloWirelessWorldServlet.java |
This is the servlet controlling the "Hello World" application. |
| error.jsp |
Default Error page for the HelloWorld Application.
There are also separate copies of this file for each markup language. (WML, HDML, cHTML, HTML). |
| helloWorld.jsp |
source page for the HelloWorld Application. There is a separate copy of this file for each markup language. (WML, HDML, cHTML, HTML). |
| web.xml |
Web Application deployment descriptor. |
| CategoryDefinitions.xml |
Descriptor file for the underlying framework which defines categories of devices. |
| DeviceDefinitions.xml |
Descriptor file for the underlying framework which defines attributes of the devices. |
| JSPSelectionRules.xml |
Descriptor file for the underlying framework which defines selection rules for the jsp pages. |
Package wireless.helloWorld Description
This example illustrates:
- Connectivity between WebLogic Server and a mobile terminal (examples: cell phone, PDA, pager, etc.).
- Generating markup language documents specific to the requesting device from within a JSP.
In this example,
helloWorld.jsp
is requested by the mobile client. The result is a simple text string presented on the client's display. This application will display properly on a client device that supports HTML, WML, HDML or cHTML. A request is received from the client by the HTTP Servlet which is then forwarded to the correct helloWorld.jsp running on WebLogic Server for the markup language needed by the device. helloWorld.jsp responds by sending a generated *ML document to the device.
Perform the following steps in order to configure and run the example:
- Build the example
- Configure the Server
- Run the Example
- Set up your development shell as described in
Setting up your environment.
We provide a build script for you to build the example, called build.xml.
- Run the build script using the following Java ant command:
$
ant
The script will build the example and place the files in the
correct locations in your WebLogic Server distribution.
- MIME types for WML, HTML, HDML, cHTML, etc. are already registered with the
Examples Web Application.
- The following JSP parameters are already registered with the
Examples Web Application and
are included here for information only.
| Parameter | Value |
| compile command | JAVA_HOME/bin/javac |
| pageCheckSeconds | 1 |
| verbose | true |
- Modify the startExamplesServer.cmd and add the following jar file to the end of the CLASSPATH: .\config\examples\applications\webFramework.jar
- Start the Administration Console and use it as described in the steps that follow to create and statically deploy this example.
- In the left-hand frame of the Administration Console, click Examples/Deployments/Web Applications.
- In the right-hand frame of the Administration Console, click Configure a new Web Application.
- In the right-hand frame of the Console, enter values for the Name, URI, and Path for the helloWorld application.
Name=helloWorld
URI=helloWorld
Path=./config/examples
Make sure that the Deployed option is checked, and click Create.
- In the right-hand frame, click the Target tab to display available servers. Select examplesServer, click the right arrow, and click Apply.
Run the Example
If needed, refer to the vendor documentation for details on starting and administering a gateway server and for using any emulator.
- Start the WebLogic Server with
the examples configuration.
- Load the helloWorld Application into a browser using a URL such as:
http://hostname:7001/helloWorld/Hello
where:
- hostname
- Host name of the WebLogic Server.
- port
- Port where the WebLogic Server is listening for connections
(weblogic.system.ListenPort).
Note, if this is not using a locally hosted and configured wireless gateway, a port other than 7001 may have to be used. The safest and most common port that most carriers support is port 80.
There's More...
Read more about:
Copyright © 2000-2001 BEA Systems, Inc.
All rights reserved.