Sunday, November 08, 2009  
Google
Web pcquest.com

CIOL Network sites

Search by Issue | Sitemap | Advanced Search

• For most updated version of DQ TOP 20 issue, visit dqindia.com • Ad : Play and Plug ERP by IBM


 
    Enterprise Solutions
    Hands On
    ITstrategy

    Developer

    Tech Forum

    SMB Forum

    Trends

    Shootout

    Reviews
    Editorials
    Linux and Open Source
    Technology
    Extraedge

    IT Careers

    Vertical Focus

Subscribe to Print magazine.


now!


Newsletter

 

Home > Technology > Advanced WAP Programming


Advanced WAP Programming

Continued from Page 1

Using Perl

As with PHP, in Perl too, you first need to send the correct MIME type to the browser. Here’s how to do it.

print "Content-type: text/vnd.wap.wml\n\n";

print "<?xml version=\"1.0\"?>\n";

print "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"\"http://www.wapforum.org/DTD/wml_1.1.xml\">\n\n";

….. Put your content here…..

Using Java servlets

Dynamic WML documents can be easily developed using Java servlets. Once you know the WML syntax, building WAP applications using Java servlets can be an easy task. Just set content type in your class and you can then send WAP tags. The line

Response.setContentType("text/vnd.wap.wml");

defines the WAP MIME type to the browser. This is followed by

import java.io.*;

import javax.servlet.*;

import javax.servlet.http.*;

public class MobileDate extends HttpServlet {

public void service (HttpServletRequest request, HttpServletResponse

response) throws ServletException, IOException {

To set the content type for your wireless data:

response.setContentType("text/vnd.wap.wml");

PrintWriter out = response.getWriter();

Now, you can write what you would like to display on the user’s screen:

out.println("<?xml version=\"1.0\"?>");

out.println("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"");

out.println(" \"http://www.wapforum.org/DTD/wml_1.1.xml\">");

out.println("<wml>");

out.println("<card title=\"Hello\">");

out.println(" <p align=\"center\">");

out.println("java with wap<br/>");

out.println("</p>");

out.println("</card>");

out.println("</wml>");

}

}

WAP pages are organized as a deck of cards, each card being one display page. There is a limit to the size of a deck of WAP cards (all that is between <wml> and </wml>). The size depends on the WAP browser, and should not exceed the following limits.

Browser Size limit
UP.Browser 3.2  1,492 bytes
UP.Browser 4.x  2,048 bytes
Ericsson R320 3,000 bytes (approx)
Ericsson R380 3,500 bytes (approx)
Ericsson MC218 8,000 bytes
Nokia 7110 1,397 bytes

 

 

 

 

 

(To be continued next month)
Gaurav Bhatnagar is a WAP project leader at rkmdaes.com




Page(s)   1   2   

End of the article

Related CIOL Network links   External links  

None

 

none



Read Previous Technology...

   




Untitled Document



ZTE:Leading CDMA Technology


Extraordinary Networks:Freedom of Choice





Previous Stories

Communicate Anywhere, Any Way

Inside the Pentium 4

The Battle over DeCSS

Message boards

Discuss this and many other IT topics at the
CIOL message board






   
 

 
 

Magazine Subscription | RQS | Contact Us | Team PCQuest | Advertising - Print | jobs@cybermedia