• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Pass parameters to the servlet

 
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a MIDlet which calls a Servlet. So far what I did was just used the write(byte b) method of the DataOutputStream to write the parameter to the servlet. What I want to know is, how can I write two different parameters. For example 'name' and the 'age' to the servlet at once. Same time how can I get these two parameters seperately. Thanks in advance........
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm not sure if this is the best advice, but if it suits your needs, you can pass them when you call the servlet - just as you would if you were sending them in the url of a jsp page
 
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ransika,

I'm afraid I don't know anything about J2ME. You may be better off posting your question in the J2ME forum.

However, if a MIDlet is the J2ME equivalent of a Servlet (!? ?!) then this may help: if you wanted to call a servlet (called Servlet2) from a servlet, passing additional parameters, you would do the following:

Maybe you can translate that to J2ME somehow?

Jules
 
reply
    Bookmark Topic Watch Topic
  • New Topic