[jboss-user] [Beginners Corner] - Re: HTTP Status 405 - HTTP method GET is not supported by th

2007-04-04 Thread prakah
Hello,

405 status code will be return when you try to access an Http 
method(get/post/etc...) which is not available.

I think, you are having doGet method and you are asking for doPost. If that is 
the case, then by adding following code in the servlet will solve the problem.


  | public void doPost(HttpServletRequest req, HttpServletResponse res)
  |  throws IOException, ServletException {
  |  doGet(req, res);
  | }
  | 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4034479#4034479

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4034479
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Beginners Corner] - Re: HTTP Status 405 - HTTP method GET is not supported by th

2007-04-04 Thread aurir_
Keep in mind that when I return PLAIN TEXT:
public void doGet(HttpServletRequest request, 
  | HttpServletResponse response)
  | throws ServletException, IOException{
  | PrintWriter out = response.getWriter();
  | out.println(Hellow World);
  | }
There is no problem. I get this error only when I return HMTL:
public void doGet(HttpServletRequest request,
  | HttpServletResponse response)
  | throws ServletException, IOException{
  | super.doGet(request, response);
  | //Tell the browser that you?re sending it HTML
  | response.setContentType(text/html);
  | 
  | PrintWriter out = response.getWriter();
  | 
  | String docType =
  | !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 +
  | Transitional//EN\\n;
  | 
  | out.println(docType +
  | 
HTML\nHEAD\nTITLEHELLO/TITLE\n/BODY\n/HTML);
  | }

Could that be some server settings??? I'm running JBoss 4.0

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4034785#4034785

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4034785
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Beginners Corner] - Re: HTTP Status 405 - HTTP method GET is not supported by th

2007-04-04 Thread aurir_
I have solved the problem. There was a couple errors:

1) When creating HTTPServlet in Eclipse I checked include doGet() which 
automatically included statement to super.get(req, res);

2) Another error that I had was very trivial. My HTML syntax was not valid.
http://validator.w3.org/ is a great webpage to validate HTML syntax.



View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4034799#4034799

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4034799
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user