This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes can COM port be accessed through servlets/applets? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "can COM port be accessed through servlets/applets? " Watch "can COM port be accessed through servlets/applets? " New topic
Author

can COM port be accessed through servlets/applets?

Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
Hi
Is it possible to read and write to com port though servlet or applets.
The scenario is to write files directly from the intranet server to the com port(mobile phones).
any help will be very great. If yes can someone plz tell me how with an example code or reference.
Thanks alot & best regards
Gul
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

If you are working from mobile phones, why aren't you using J2ME? Through J2ME you have your HTTPConnection object to communicate with a Servlet, and receive responses back from it.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12809
    
    5
Servlets can write to ports using the COMM API, but imagine the confusion if more than one request wanted the same port! Plain applets are prevented from using the COMM API by the security manager, you would have to have a signed applet. Maybe its time to re-think the architecture?
Bill
Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
Thanks guys.. i think it really is time to rethink the architechure. my client wanted his website, which has ringtones etc, to write directly to the mobile phone rather than storing it on the pc and than using the mobile's utility to copy it to phone.
I think it would be more feasible and easier to download the stuff to the computer!
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

You can still use the cell phone to connect to download the ring to the phone directly using J2ME. I am pretty sure.
In J2ME you can use all the Connection objects. Sockets and through URLs. This would be the easiest and best in my opinion.
Well, the only problem here, come to think of it, is that this application that is made using J2ME needs to be installed on the cell phone.
Mark
Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
exactly!
the point is to just plug in the phone and download it.I just realized that the folders on the phone are visible in the windows explorer the way we can explore the cd-rom etc, once the cable is connected.
so on the application part there is nothing to do, when for downloading the save option pops up the user can just explore to the required directory and let the pc download directly to that.
guess that was pretty easy for now, hope i dont run into some new problem with that & thanks for replying to the post
Cheers and regards
Gul
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can COM port be accessed through servlets/applets?