aspose file tools*
The moose likes Servlets and the fly likes parameter from MIDlet cannot be displayed at servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "parameter from MIDlet cannot be displayed at servlet" Watch "parameter from MIDlet cannot be displayed at servlet" New topic
Author

parameter from MIDlet cannot be displayed at servlet

Mohd Hafiz Ishak
Greenhorn

Joined: May 28, 2006
Posts: 3
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

Joined: Jan 10, 2002
Posts: 61426
    
  67

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?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: parameter from MIDlet cannot be displayed at servlet