Can you access multiple Servlets from one J2ME application?

Soldato
Joined
12 Sep 2003
Posts
11,107
Location
Newcastle, UK
I'm a little confused as to how I would go about doing this. I have successfully made a menu on my J2ME application which can do various things to a database. However, I'd like each section to call a specific Servlet designed for the job. How can I do this?

At the moment I have the URL declared at the beginning pointing to the correct place, and the web.xml file set to load the correct servlet. But how do I tell the application to load a different file from before, depending on which menu option was picked.

i.e. if Option 1 was chosen, then it will load the servlet to querry the DB. But if Option 2 was chosen, then I would want to load a servlet to add to the DB.

Hope that makes some sense. Thanks for any tips! :)
 
Why is it you always find the answer AFTER posting for help. :p :rolleyes:

I found when scanning through the code for the J2ME application, when it opens the HTTPConnection it does this...

Code:
HttpConnection c = (HttpConnection) Connector.open(url);

URL is declared at the start of my code, so I could simply create a new one called url2 or something for that specific connection. D'oh.

This can probably be deleted Dons when you get a chance.

Cheers. :o
 
Back
Top Bottom