• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

405 error  RSS feed

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem with my programm

my program is: <form action=TestUser3 METHOD="post">


<input type="radio" name="kaspomat" value="a1" >
radio button 1




<input type="radio" name="kaspomat" value="a10" >
radio button 2

and servlet: */
public void doPost(HttpServletRequest request1, HttpServletResponse response1) throws ServletException, IOException {{


try {
super.doPost(request1, response1);
} catch (ServletException e) {
e.printStackTrace();
} catch (IOException e) {

e.printStackTrace();
}

doPost1(request1, response1, null);




void doPost1 (HttpServletRequest request1, HttpServletResponse response1, Object object)throws ServletException,IOException {

try {
if(request1.getParameter("radios") != null) {

if(request1.getParameter("radios").equals("a1")) {

javax.servlet.RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/indexa1.jsp");
rd.forward(request1, response1);



}

if(request1.getParameter("radios").equals("a10")) {
response1.sendRedirect("http://www.ynet.il");
}

when I run this programm I get: HTTP Status 405 - HTTP method POST is not supported by this URL


please someone can tell me why it happen? what the problem with my program?

 
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please format your code and put some comments to indicate where every thing begins and ends.
You are calling super.doPost() , aren't you are supposed to call your doPost1() ?
 
Marshal
Posts: 5965
916
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your servlet Java extends HttpServlet . Normally, we only need to rewrite the doPost or doGet method to deal with the "get" or "post" in the form.There'are so rules to obey while naming the function.
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The default doPost implementation in HttpServlet put 405 error code in response. Since you are calling default impl from your doPost implementation so you getting it in your response. Nothing strange!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!