Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pass parameters to the servlet

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • 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........
 
Lisa D'Aniello
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • 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
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic