Skip to main content

Web Server for Mobile Devices. How to add servlet container..

6 replies [Last post]
bogdan_
Offline
Joined: 2008-07-01

Hello.
I am working at a Web Server for Mobile Devices in J2ME. I made allready the base structure with sockets.

I want to add a servlet container so i can call different servlets on my mobile web server from the internet.

The only examples and infos i've found on the web were on how to create a servlet for a desktop web-server and how to make a J2ME device interact with a servlet-based Web system over the internet. I want to make the opposite.

The most helpful link i've found is http://developers.sun.com/mobility/midp/articles/tutorial2/ .

It says how to create a servlet and deploy it, using Tomcat and then it show how to create a MIDlet that comunicates with a web server and connects to the servlet.

I dont think i can use that information to create a servlet container on my web server for mobile devices

If you have any ideas on how to start doing this , on how to create a servlet for a mobile device and how to add a servlet container on my web server for mobile devices please tell me.

any help is appreciated. thank you

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kwty
Offline
Joined: 2009-01-13

hi,

i am a student of Kuwait University ( Computer Engineering ) and i have senior project of making mobile web server with java (j2me) so would you please give the instructions and taps to create the mobile web server where my project will be similar to the new released product at (mymobilesite.net), please??

terrencebarr
Offline
Joined: 2004-03-04

TO expand on what Shawn said: NetBeans Mobility also has a "Web Services Client Wizard" which allows you to consume SOAP web services on a mobile device even if the device does not support 172. It does this by creating a proxy that converts the SOAP web services and providing a client-side library to consume them. All the client needs to support is HTTP.

Finally, there is also a Mobile Ajax library that allows you to interact with Ajax-style web services via JSON.

-- Terrence

vijay_gopal
Offline
Joined: 2008-04-25

Thank u for your valuable suggestion on web services. Here i am working on creating a mobile based web application. This works fine with wireless toolkit and able to access normal servlet . Is it advisable to use a midlet to access a servlet page?

Kindly reply
Thank u

terrencebarr
Offline
Joined: 2004-03-04

bogdan,

There is no concept of creating servlets in MIDP - MIDP does't have any web server functionality and lacks the servlet API.

However, if your platform supports MIDP 2 and ServerSocket then you can build your own servlet infrastructure.

But more importantly, why are you trying to do this? What is the application or use case for a web server on a mobile device?

-- Terrence

vijay_gopal
Offline
Joined: 2008-04-25

I have tried invoking a servlet from a midlet which worked fine. It works as in normal web application. Can we replace a midlet by a mobile web service client and on the server side use a web service to access the same service?

Any suggestions for the above query is appreciated .

Thank You

sfitzjava
Offline
Joined: 2003-06-15

If you mean can web services be added to a MIDlet as the communication protocol and does if follow the same format as standard web services, the answer is yes. However the phone needs to support JSR 172 J2ME Web Services.

-Shawn