(keitai-l) Accesng web server

From: Dibyendu <dibyendu.bhattacharya_at_eximsoft.com>
Date: 11/26/01
Message-ID: <00bd01c1766d$5cfd6df0$800a0a0a@exim.com>
dear sir , I wrote a simple iApplication to read a text file from apache web
server runing in local machine .

But it is giving the exception ....
java.lang.SecurityException: package URL mismatch

the code is like this ...

Any one please tell me what is going wrong here . Do i need to configure
anything for that ?


 import com.nttdocomo.ui.*;
 import com.nttdocomo.io.*;
 import javax.microedition.io.*;
 import java.io.*;
 import com.nttdocomo.net.*;
 public class Network extends IApplication
  {
   String extractedText;
   public Network () {
     }
  public void start() {
    try{

       HttpConnection hc =
(HttpConnection)Connector.open("http://localhost:80/abc.txt");

       hc.setRequestMethod(HttpConnection.GET);
       hc.connect();
       InputStream is = hc.openInputStream();

       byte[] text=new byte[(int)hc.getLength()];
       is.read(text);
       String s = new String(text);
       extractedText = "hello";
       is.close();
       hc.close();
        }
         catch(Exception e){
          extractedText = e.toString();
          System.out.println(e.toString());
          e.printStackTrace();

          }
           Panel p = new Panel();
           TextBox tb = new TextBox(extractedText, 18,
4,TextBox.DISPLAY_ANY);
           p.add(tb);
           Display.setCurrent(p);
         }
     }

regards ,
Dibyendu .


[ Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/ ]
Received on Mon Nov 26 13:26:00 2001