There is a nokia HelloWorld servlet attached which explains how to make
servlets for wap. They are very similar to http servlets!

no extra sdk's or jar archives required!

hopefully this can be of use
Rob

Charles Forsythe <[EMAIL PROTECTED]> wrote:
> > To handle WAP (the mobile equivalent of HTTP) is more problematic. I
> > suspect you'll need a servlet engine specifically designed to support
> > WAP.
> 
> Specifically, you'd subclass the generic Servlet class into something like
> WapServlet.
> 
> -- Charles
> 
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
> 
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloWorld extends HttpServlet
{
    String m_text;

    public void init(ServletConfig config) throws ServletException
    {
        super.init(config);
        m_text = config.getInitParameter("text");
        if (m_text == null)
        {
            m_text = "This is a simple test servlet.";
        }
    }

    public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
        throws IOException, ServletException
    {
        response.setContentType("text/vnd.wap.wml");
        PrintWriter out = response.getWriter();
        out.println("<?xml version=\"1.0\"?>");
        out.println("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" 
\"http://www.wapforum.org/DTD/wml_1.1.xml\">");
        out.println("<wml>");
        out.println("<card id=\"card1\" title=\"Hello World\">");
        out.println("<p>");
        out.println(m_text);
        out.println("</p>");
        out.println("</card>");
        out.println("</wml>");
        out.close();
    }

    public String getServletInfo()
    {
        return "This is a pointless servlet!.";
    }
}

Reply via email to