Home
| | Sitemap
||Page number :3
Programmer's Guide Nokia WAP Server API 1.1 page 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
previous || guide home || next
Overview of Java Servlets for the Nokia WAP Server
2.1 Motivation for server side programming with Java Servlets
Developing advanced online services to be used either through a web browser or a WAP terminal usually requires server side programming. Various technologies are nowadays used to handle clients' requests and to generate dynamic content such as shopping carts and customised home pages.
Technologies such as Common Gateway Interface (CGI) scripts written in Perl or C/C++ have been widely used in the development of dynamic services. Nowadays, however, Java Servlets are becoming commonly used as an efficient platform-independent replacement for (CGI) scripts. The main benefits of using Java Servlets for server side programming are e.g.:
- Persistency. Instead of creating a separate process for each request, servlets are typically loaded only once by the server and servlets can maintain services such as database connection between requests (persistent).
- Performance. Due to the persistency, servlets perform better than CGI.
- Portability. Servlets provide the benefits of the Java language: it is easy to code due to the object model and it is platform-independent (Java Servlets already written for web servers can be easily modified to be deployed also on the Nokia WAP Server).
- Connectivity. Java Servlets can act as middleware to enterprise Java Beans (through RMI, IDL) and other resources also via protocols other than HTTP.
For further information on the use of Java Servlets for server side programming and integration with various environments, see [1].
2.2 Servlet architecture overview
The servlet architecture in the Nokia WAP Server is similar to the Java Servlet concept defined by Sun Microsystems Inc., which is widely used on web servers for server side programming.
The basic interaction is based on a request-response model. The following figure shows the overall architecture.
The architecture has three major parts:
WAP Terminal. The mobile user is using a user agent program on the WAP terminal. Typically, the user agent is a WAP Browser for viewing WML pages and executing WMLScripts. The WAP Terminal uses the WAP protocol in the wireless network to connect to a WAP gateway.
Nokia WAP Server is communicating with WAP terminals in the wireless network with WAP protocols. When receiving a WAP request from the terminal, the Nokia WAP Server creates a HttpServletRequest and forwards it to the correct servlet. The Nokia WAP Server takes care of some of the underlying functionality like managing the servlets and their configurations, managing the requests, forwarding the request to the correct servlet, decoding the WAP request for the servlet, encoding the WML and WMLScript responses and encoding the HTTP headers for the WSP protocol. In addition to these, the server can perform user authentication, access control, response caching, etc.
WAP Service. A servlet receives a request as an HttpServletRequest object from the mobile user via the Nokia WAP Server, processes the request and uses the provided HttpServletResponse to send the response to the mobile user.
In addition to the Java Servlet interfaces, a WAP service can use other services provided by the Nokia WAP Server. A WAP service can also use other servlets to complete its tasks.
Programmer's Guide Nokia WAP Server API 1.1 page 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
previous || guide home || next