This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

parameter from MIDlet cannot be displayed at servlet

 
Mohd Hafiz Ishak
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a parameter value "hello" is send by midlet ( String message = "name=hello"; ) to servlet. and servlet responds to MIDlet(at MIDlet display " Received name:hello "). ..im using tomcat 5.5. below is a servlet code

import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;

public class PostServlet extends HttpServlet {
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
String name = request.getParameter("name");

String message = "Received name: '" + name + "'";
response.setContentType("text/plain");
response.setContentLength(message.length());
PrintWriter out = response.getWriter();
out.println(message);
}
}

its appear "HTTP Status 405 - HTTP method GET is not supported by this URL" when i try to run at tomcat..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mohd Hafiz Ishak:

its appear "HTTP Status 405 - HTTP method GET is not supported by this URL" when i try to run at tomcat..


Look at this error message, then look at the code for your servlet.

Do you see anywhere where you wrote support code for GET?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic