Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
    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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Still getting same error

Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Report post to moderator
I wrote this html file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


Please enter your username and password
<form action="/Ch05/Login" method="POST">
<p><input type="text" name="username" length="40">
<p><input type="password" name="password" length="40">
<p><input type="submit" value="Submit" >

and the java class which it calls is
package web;
import javax.servlet.*;
import javax.servlet.http.*;

public class Login extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
{ String username = request.getParameter("username");
try {
PrintWriter writer = response.getWriter();
writer.println("Thank You, "+ username + ". You are now logged into the system.");
}catch (Exception e) {
but when I am deploying it it giving the error as

"HTTP method POST is not supported by this URL" can somebody explain this?
Posts: 25594
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Report post to moderator
Your HTML points to this URL: /Ch05/Login

And the code you pointed to is a servlet named: /web/Login

Now maybe you have a servlet mapping that connects that URL to that servlet. But I think it is more likely that you have another Login servlet somewhere that is the real problem.
Rahul Bajaj
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Report post to moderator
Thanks a worked. Actually I had 2 Login.class files. Thanks...I have been trying this since morning.
Posts: 67399
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please continue the discussion in the original post.
If we don't do the shopping, we won't have anything for dinner. And I've invited this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic