This week's book giveaway is in the Testing forum.
We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line!
See this thread for details.
Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to foce Nokia 7210 SDK to use HTTP rather than WAP?

Chua Wen Ching
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
In the Nokia 7210 Emulator, I click File -> New
and i enter my ip address called:
I can't get the phone to access it...
so I play with the Tools -> Settings
and under Wap Networking, the gateway ip is (i try to set it to 0.0.0, but can't work)
and under the MIDlet Networking, i already check the Enable HTTP communication checkbox.
To QC, i go to Tools -> Status Window
AND I notice that no matter what it still goes to WAP Communication Requests 1 (the counter will increment)
The HTTP Communication, Request still 0. (i try to connect to the internet, also http request is still 0)
Sad story, so i do some coding in servlest and midlets
Well i learn from the java sun website...
Below is the source code:
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
* An example MIDlet to invoke a CGI script.
public class FirstMidletServlet extends MIDlet {
private Display display;
String url =
public FirstMidletServlet() {
display = Display.getDisplay(this);
//Initialization. Invoked when MIDlet activates
public void startApp() {
try {
} catch (IOException e) {
System.out.println("IOException " + e);
//Pause, discontinue ....
public void pauseApp() { }
//Destroy must cleanup everything.
public void destroyApp(boolean unconditional) { }
//Prepare connection and streams then invoke servlet.
void invokeServlet(String url) throws IOException {
HttpConnection c = null;
InputStream is = null;
StringBuffer b = new StringBuffer();
TextBox t = null;
//Form t = null;
try {
c = (HttpConnection);
"20 Jan 2001 16:19:14 GMT");
"Profile/MIDP-1.0 Configuration/CLDC-1.0");
c.setRequestProperty("Content-Language", "en-CA");
is = c.openDataInputStream();
int ch;
// receive response and display it in a textbox.
while ((ch = != -1) {
b.append((char) ch);
t = new TextBox("First Servlet",
b.toString(), 1024, 0);
// t = new Form(b.toString());
} finally {
if(is!= null) {
if(c != null) {
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
* The simplest possible servlet.
public class HelloServlet extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
PrintWriter out = response.getWriter();
out.println("Servlet invoked!");
out.println(new Date());
And it works fine. I can see now it goes directly to Http rather than Wap anymore.
*Note: The servlets and compilation of the java works fine.
Any idea. How to make the emulator possible to "force-to-point" at HTTP rather than WAP.
Chua Wen Ching
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic