Dear Sir/Madam,
I have a java me application and now I want to place that application at the server. I want to write the download page with servlet. I mean when the user keys in the servlet url and hit to that servlet, my jad file will send to the phone(user no need to click to download button or link.After page loading, the servlet will automatically send the jad file to the requested mobile phone.).
I tried with this code.
> File exportFile = new File("C:\\Voice.jad");
> response.setContentType("text/vnd.sun.j2me.app-descriptor");
> response.setContentLength((int)
> exportFile.length());
> response.addHeader("Content-Disposition",
> "attachment; filename=" +
> exportFile.getName());
> OutputStream os= response.getOutputStream();
> InputStream is = new FileInputStream("C:\\Voice.jad");
> while (is.available() > 0) { char c =
> (char) is.read();
> os.write(c); }
> os.flush();
> is.close();
and I tried to download the application from Nokia Series 40th 5rd edition emulator. It shows the jad file's information and try to install. But on the way for installing, it said jar file doesn't exist.
I don't know how to move on. Please give me some information or samples. How can I write the download page for java me application at the servlet?
Thanks you, With Regards