As shown in the figure, mobile browsing based on Java EE application servers concerns much more than just the UI - it also involves the business logic and integration to the service layer. The UI presentation logic resides in the Java EE web container and the business logic in the Java EE EJB container. The same presentation logic, as well as business logic, is used for both web browsing and mobile browsing. The integration layer provides a
Parlay X /
SOAP connection, via the internet, to the telecom web services in the service layer. In the figure, Parlay X could be substituted by for example the Ericsson
IPX.
MIME in web server
Before you begin building WML-based pages make sure that your web server supports correct content MIME mapping between the HTTP header and the WML file extensions e.g. *.wml.
Examples of MIME mapping between HTTP "contentType" and file extension:
"text/vnd.wap.wml" for *.wml
"application/vnd.wap.wmlc" for complied WML *.wmlc
"application/vnd.wap.wmlscriptc" for WML Script Source wmls
"application/vnd.wap.wmlscriptc" for Compiled WML Script
”*.wmlscriptc”
vFor xhtml_mp you may already have:
"application/xhtml+wml" for *.xhtml extensions
WML on Java Servlet and Java Server Pages
WAP based web applications can easily be built on common Java EE Servlet and Java Server Pages (JSP) with, for example, Apache Tomcat, or on a common Java EE Application Server with web container (WML presentation layer) and EJB containers.
If you are building dynamic WML pages for WAP applications the type of content is also important to be defined on JSP pages or Java Servlet.
Example on Java Server Pages (JSP) for WML:
<%@ page contentType="text/vnd.wap.wml" %>
Example on Java Server Pages (JSP) for xhtml-mp:
<%@ page contentType="application/xhtml+xml” %>)
The JSP programming is the same as for HTML but using WML tags.
Example:
<%@ page contentType="text/vnd.wap.wml" %>
<jsp:useBean id="beanInstanceName" scope="session" class="package.class" />
<jsp:getProperty name="beanInstanceName" property="*" />
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">
<wml>
<template>
<!-- Template implementation here. -->
<do type="prev"><prev/></do>
</template>
<%
if (session.isNew() || session.getAttribute("userid")==null ) {
%>
<card id="card1" title="Card #1">
<do type="unknown" label="Next">
<go href="#card2"/>
</do>
<p align="center">
<big><b>First Card</b></big>
</p>
</card>
<%
} else {
%>
<card id="card2" title="Card #2">
<p align="center">
<big><b> <%= beanInstanceName.getUserid() %> </b></big>
</p>
</card>
<%
}
%>
</wml>