Results 1 to 2 of 2
  1. #1
    sharmaj2me is offline Member
    Join Date
    Oct 2008
    Posts
    2
    Rep Power
    0

    Default How to pass value from servlet to midlet?

    Display values from Servlet into Midlet
    I need to display value in textbox in emulator.
    In servlet i put out.println but it displays content available in out.println (html tags).

    Thanks

  2. #2
    only4java's Avatar
    only4java is offline Member
    Join Date
    Dec 2008
    Location
    Pune
    Posts
    2
    Rep Power
    0

    Smile Check the content type of Srervlet

    Hi sharmaj2me,

    You have to set content type of servlet to text/plain.
    You can try this in your servlet.


    Java Code:
                String message= "My Message";
                response.setContentType("text/plain");
                response.setContentLength(message.length());
                PrintWriter out = response.getWriter();
                out.println(message);

    Thanking You,

    Only4Java

Similar Threads

  1. how to pass a List from a servlet to javascript..
    By hussainzim in forum Java Servlet
    Replies: 2
    Last Post: 09-09-2008, 01:17 PM
  2. Connectivity between Servlet and Midlet
    By adarsh_2484 in forum New To Java
    Replies: 1
    Last Post: 07-29-2008, 05:09 PM
  3. Pass by ref. A work around?
    By diRisig in forum New To Java
    Replies: 0
    Last Post: 02-05-2008, 08:25 PM
  4. how to pass array in java?
    By sivasayanth in forum New To Java
    Replies: 3
    Last Post: 01-13-2008, 05:33 PM
  5. MIDLet calling Servlet
    By ravian in forum Java Servlet
    Replies: 1
    Last Post: 12-06-2007, 01:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •