HTTP Status 405 - HTTP method POST is not supported by this URL

dear all
can u solve my problem.am getting the *"HTTP Status 405 - HTTP method POST is not supported by this URL"* msg from the browser when i press the search button in my form.plz suggest me the solution for my fault.these are the following html,xml,class files:
search.html*
<html>
<head>
<title>Search Page</title>
</head>
<body>
<p align="center"><font size="6" color="#0000FF"><b>Search Module</b></font></p>
<p align="center"> </p>
<center>
<form method="POST" action="./emp">
<table border="1" width="43%">
<tr>
<td width="50%">
<p align="right">Employee Name</td>
<td width="50%"><input type="text" name="empname" size="36"></td>
</tr>
<tr>
<td width="100%" colspan="2">
<p align="center"><input type="submit" value="Search" name="B1"></td>
</tr>
</table>
</form>
</center>
</body>
</html>
web.xml*
<web-app>
<servlet>
<servlet-name>jdbc</servlet-name>
<servlet-class>searchModule</servlet-class>
<init-param>
<param-name>driver</param-name>
<param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
</init-param>
<init-param>
<param-name>url</param-name>
<param-value>jdbc:odbc:first</param-value>
</init-param>
<init-param>
<param-name>user</param-name>
<param-value>scott</param-value>
</init-param>
<init-param>
<param-name>pass</param-name>
<param-value>tiger</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>jdbc</servlet-name>
<url-pattern>/emp</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>search.html</welcome-file>
</welcome-file-list>
</web-app>
SearchModule.java*
import java.util.*;
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class searchModule extends HttpServlet
Connection con;
public void init() throws ServletException
String d=getInitParameter("driver");
String u=getInitParameter("url");
String us=getInitParameter("user");
String pwd=getInitParameter("pass");
try
Class.forName(d);
con=DriverManager.getConnection(u,us,pwd);
catch(ClassNotFoundException e)
System.out.println(e);
catch(SQLException e)
System.out.println("Unable to establish the connection");
}//init
public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
String empname=req.getParameter("empname");
res.setContentType("text/html");
PrintWriter pw=res.getWriter();
try
pw.println("<html><body><center>");
Statement st=con.createStatement();
String sql="select * from employee where empname="+empname;
ResultSet rs=st.executeQuery(sql);
if(rs.next())
pw.println("<h2>Employee Details</h2>");
pw.println("<table border=1>");
pw.println("<tr><th>Employee No.</th>");
pw.println("<th>Employee Name</th>");
pw.println("<th>Designation</th>");
pw.println("<th>Department</th>");
pw.println("<th>Salary</th>");
pw.println("</tr><tr>");
pw.println("<td>"+rs.getInt(1)+"</td>");
pw.println("<td>"+empname+"</td>");
pw.println("<td>"+rs.getString(3)+"</td>");
pw.println("<td>"+rs.getString(4)+"</td>");
pw.println("<td>"+rs.getInt(5)+"</td>");
pw.println("</tr></table>");
else
pw.println("<h2>Employee Record Not Found</h2>");
pw.println("</center></body></html>");
pw.close();
rs.close();
st.close();
catch(SQLException e)
System.out.println(e);
}//doPost
public void destroy()
if(con!=null)
try
con.close();
catch(Exception e)
System.out.println("Connection Closed");
}//destroy
}//searchModule
in control panel i selected System DNS and created the name as first and driver as Microsoft ODBC for Oracle
plz suggest me the solution where i committed mistake.

<form method="*POST*" action="./emp">
public void doGet (HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
HTTP method POST is not supported by this URL

Similar Messages

  • 405 HTTP method POST is not supported by this URL

    When I use GET method to browse a servlet by using TOMCAT or Resin, receive the following message:
    405 HTTP method POST is not supported by this URL
    Thanks!

    Just post your question once and be patient:
    http://forum.java.sun.com/thread.jspa?threadID=573890
    %

  • HTTP method POST is not supported by this URL

    Hi everyone,
    I'm having a problem in my application.
    I used the ADF Security Wizard to enable the ADF Security in my application. So, it created the pages login.html, error.html and welcome.jsp.
    The problem is when I try to sign in in my applicaton. On the page login.html I filled in the fields username and password and click on the button to post the form. But when the form is posted I get the message: "HTTP method POST is not supported by this URL".
    The form is posted to the bean j_security_check.
    Does anybody know why is it happening? What should I do to fix it?
    Thanks a lot
    Daniel
    Edited by: [email protected] on 23/02/2010 05:37

    Normally when you get this error, your username/password is not correct.
    It's not a clean way of errorhandling. I have had the same issue and after a while i noticed the password i entered was not correct.

  • 405 HTTP method GET is not supported by this URL

    When I use GET method to browse a servlet by using TOMCAT or Resin, receive the following message:
    405 HTTP method POST is not supported by this URL
    Thanks!

    Just post your question once and be patient:
    http://forum.java.sun.com/thread.jspa?threadID=573890
    Go out and get a servlet book. Don't you know how to write servlets?
    %

  • Problem:HTTP Status 405 - HTTP method GET is not supported by this URL

    Hi
    I m beginner.I try to invoke servlet using HTML page with doPost method .I put the html file in Tomcat4.1/webapps/root and put the class file in Tomcat4.1/webapps/root/WEB-INF/classes. So when i put the url in the browser the html page is diplayed but when i sumit it to open the servet it gives this error HTTP Status 405 - HTTP method GET is not supported by this URL.I give the servlet name and class in web.xml also have done its mapping but still it is not working.Whereas the simple servet runs like HelloWord but when i use html page to run servlet it does'nt work.
    Plz help me out.
    Thanx

    Hi,
    I have also encountered this problem while running my web-application under tomcat 3.3.2. My application is resided in webapps directory. And servlet class is placed inside <app-dir>/WEB-INF/Classes/com/rEWebSite/Servlets.
    <web-app>
    <servlet>
    <servlet-name>
    LoginServlet
    </servlet-name>
    <servlet-class>
    com.rEWebSite.Servlets.LoginControlServlet
    </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>
    LoginServlet
    </servlet-name>
    <url-pattern>
    /Login
    </url-pattern>
    </servlet-mapping>
    </web-app>
    This is script in web.xml file. And after clicking on the link it is showing http://localhost:8080/<app-dir>/Login .
    If anyone knows a solution, plz reply me.

  • GRMG RFC Configuration "HTTP method GET is not supported by this URL"

    Hi All,
    when i create the RFC Destinaton for SLD  with regards to GRMG Configuration and test the rfc i get the Reason code 400 with error "HTTP method GET is not supported by this URL".
    Even if i call  http://hostname:port/sld/rtc in the browser i get the same error.
    RFC Details:
    Target machine:Host
    Service No: port no
    path prefix: /sld/rtc
    My other RFC destinations for rwb,IR,ID,Adapter Engine works well.
    I would appreciate your suggestions on this
    Aravind

    Hi David,
    I feel sorry to wake this thread up after long time.
    It's the same situation, connection testing for SLD returns 400 "HTTP method GET is not supported by this URL".
    However, CCMS hearbeat seems to work fine with SLD. It returns green.
    I have a question here. Is it OK if we leave it that way without changing GRMG?
    Is there any potential problem, or side effect when the RFC destination returns 400?
    Thank you very much,
    Teyun

  • Error: HTTP method GET is not supported by this URL

    Hey,
    I am attempting to overload the doGet method with a Wrapper class I created for HttpServletReponse that extends it of course and I receive this error: "HTTP method GET is not supported by this URL". I figure you can't change the method as I have but I am curious if there is anyway I can go about to accomplish what I am trying to do. Basically I just need to extend the HttpServletResponse so that it contains a few more variables and such.
    public class test extends HttpServlet {
        public void doGet(HttpServletRequest request,  XmlServletResponseWrapper response) throws ServletException, IOException{
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();
            out.println("<html>");
            out.println("<head>");
            out.println("</head>");
            out.println("<body>test</body>");
            out.println("</html>");
       

    public void doGet(HttpServletRequest request, XmlServletResponseWrapper response)
    is not the same method as
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    The servlet container is going to call the later method and since you did not overwrite it to provide an implementation it sees the GET request as not being supported.
    what you are looking to do is something like this:
    public void doGet(HttpServletRequest request,  HttpServletResponse response) throws ServletException, IOException{
            XmlServletResponseWrapper myResponse = (XmlServletResponseWrapper ) response;
            myResponse .setContentType("text/html");
            PrintWriter out = myResponse .getWriter();
            out.println("<html>");
            out.println("<head>");
            out.println("</head>");
            out.println("<body>test</body>");
            out.println("</html>");
       

  • HTTP method GET is not supported by this URL

    hi.. I am trying one Cookie example.. I m ready with the class file.. and I have deployed it in Tomcat.. but when I am trying to run this the error "HTTP method GET is not supported by this URL" is coming..
    Pls give some clues so that I can run this....

    Implement HttpServlet#doGet() in your servlet.

  • POST method not supported by this URL

    Hello gentlemen,
              We are trying to migrate our servlets from another Web Application
              Server (IBM WebSphere 2.02) to Weblogic 4.5.1.
              A servlet that did work fine with WebSphere, now produces the "POST
              method not supported by this URL" error under Weblogic.
              Of course, we implement doPost method in our servlet.
              Any idea to fix this problem? thank you.
              emanuele
              

              Emanuele--
              In the ICSessionServlet file you are posting the data to ICIdentification servlet which is
              again a servlet
              So you need to register this servlet in weblogic.properties file before you post something to
              this servlet.
              Also the way you are calling the servlet is totally wrong from weblogic standpoint
              You don't need to specify the package name in weblogic(this is OK in java web server) for e.g.
              icdoor.myservlet.session.ICIdentificationServlet.
              Because we are registering the servlet with full package name in properties file so we don't
              need to mention the package
              name here..
              Call the servlet in the following way or whichever way is suitable for you.
              Here is how i'm calling ICIdentificationServlet
              http://localhost:7001/ICIdentificationServlet
              Here is the output i'm getting after entering user name/password
              "Welcome Startfighter"
              Requested URL
              http://localhost:7001/Stupida
              Hope this helps
              Kumar
              emanuele wrote:
              > Here's the source code for a servlet producing "HTTP method POST is not
              > supported by this URL".
              >
              > I have registered servlet Stupida in the file weblogic.properties. This
              > servlet subclass the ICSessionServlet.
              > The service() method of ICSessionServlet ask for a userid and a password
              > (user and password are not verified, anyway) and then calls the doPost()
              > method of ICIdentification servlet. This one displays a sort of "Welcome
              > page" and then the calling URL. (if it works fine...).
              >
              > On WebSphere, it works. On Weblogic, it doesn't.
              >
              > Any idea?
              >
              > emanuele
              >
              > "Kumaraswamy A." wrote:
              >
              > > can you post the stacktrace , also if possible send your java file
              > > too!..
              >
              >
              

  • HTTP Method Post not supported by this URL

    We are running WL6.0sp1 on Win2000. When we try to open a JSP page which calls
    a servlet we get a "HTTP Method Post not supported by this URL". This same setup
    (WL 6.0sp1 on Win2000) on another machine works absolutely fine running from the
    same client. Is there any setup that needs to be done in Weblogic for this? Any
    pointers on this would be appreciated.
    Rgds

    Normally when you get this error, your username/password is not correct.
    It's not a clean way of errorhandling. I have had the same issue and after a while i noticed the password i entered was not correct.

  • GET is not supported by this URL

    I have created a simple droplet and I tried to see output in my jsp page.
    But I am getting bellow message with blank page - "GET is not supported by this URL"
    I am new to ATG :)
    Looking for any help.....
    Thnx in Adv.!!!!
    Rajib

    I think u r placed super.service() method in ur code.. Pls remove that one.. it wil work fine.

  • HT1918 Everytime I try to purchase music I get.... Update payment method PayPal is not supported on this device.... Help!!!!

    I can't purchase songs any longer using ITunes. The message I receive is Paypal is not supported by this device. Problem with previous payment update acct info. ... I did update acct info! Help?????

    I had this same problem also.  The problem has to do with your credit card number associated with you iCloud account.  To solve this problem, you need to update your credit card/payment information by doing the following on your iPad / iPhone / iTouch:
         Settings > iCloud > click on your account > Payment Information
    Update this section with your correct credit card information and Save.

  • HTTP Status 405

    Hi All
    When I try and run my servlet (using tomcat) I get the following error:
    HTTP Status 405 - HTTP method GET is not supported by this URL
    type Status report
    message HTTP method GET is not supported by this URL
    description The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).
    Apache Tomcat/5.5.17
    Ive tested a few other servlets but they seem to be working fine but the servlet code seems to be ok as I've checked it with a servlet programming book.
    package website;
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ProductServlet extends HttpServlet {
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    res.setContentType("text/html");
    PrintWriter out = res.getWriter();
    try {
    // Load (and therefore register) the Oracle Driver
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    // Get a Connection to the database
    con = DriverManager.getConnection(
    "jdbc:odbc:product", "", "");
    // Create a Statement object
    stmt = con.createStatement();
    // Execute an SQL query, get a ResultSet
    rs = stmt.executeQuery("SELECT TITLE, DESCRIPTION FROM PRODUCTS");
    // Display the result set as a list
    out.println("<HTML><HEAD><TITLE>Products</TITLE></HEAD>");
    out.println("<BODY>");
    out.println("<UL>");
    while(rs.next()) {
    out.println("<LI>" + rs.getString("title") + " " + rs.getString("description"));
    out.println("</UL>");
    out.println("</BODY></HTML>");
    catch(ClassNotFoundException e) {
    out.println("Couldn't load database driver: " + e.getMessage());
    catch(SQLException e) {
    out.println("SQLException caught: " + e.getMessage());
    finally {
    // Always close the database connection.
    try {
    if (con != null) con.close();
    catch (SQLException ignored) { }
    }

    The server is complaining about the GET request method not being supported by your servlet and it is right: your servlet does not have a doGet() method. A GET is performed when the servlet is invoked by calling it as a regular url for example. To fix your problem you could add this:
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    doPost(req, res);
    }

  • Unable to log into the SAP River RDE environment (HTTP Status 405)

    Hi All,
    Is anyone else facing this issue as well? I have previously been able to access the River RDE, but now I am unable to login.
    From the Hanatrial cockpit, when I access my RDE subscription, and click on the rde link, I get an error message as follows:
    HTTP Status 405 -
    type Status report
    message
    description The specified HTTP method is not allowed for the requested resource.

    Getting the same error. Last week the RDE subscription did work. So I think that there is a general config problem (cause also no updates were done in the River RDE setting up documentation -> SAP HANA Cloud Platform).
    Regards, Florian

  • HTTP Status 404 indicates a resouce is not available - how to do you overcome this issue?

    Web site offers visitors the opportunity to the Newsletter 1) Trouble viewing the Newsletter.....
    2) View it online 3) Download a Printer friendly copy. Trying any of these options generates an Apache Tomcat/5.5.27 - Error report. This in turn throws up a report along the lines of HTTP Status 404 indicating a resource is not available. Are there any fixes possible from my end or should I notify the Newsletter sender of error at their end?

    I think it means that it could not find what it's looking for. Check the links.

Maybe you are looking for

  • Quote report

    Hi, Is there a nstandard report in SAP for quotes that tells us how many quotes that were created were completed and how many were left open. In other words a WIN/LOSS scenerio meaning some might have been converted to Sales orders while others left

  • Lost Changes to Script

    In this case this is not a huge deal, but obviously it could be and still it's frustrating. I spent 2 or 3 hours reworking the opening of a sci-fi script - lots of the world to introduce - which part of the solar system - the dwarf planet where the s

  • "The user profile service failed the logon. User profile cannot be loaded."

    I recently purchased a refurbished laptop from MTC (windows 7) and have been trying to remote into the windows systems at my school but I keep receiving this error message.  I'm aware there are dozens of threads on this topic but mine is slightly dif

  • Firefox 27.0.1 on a Mac OS 10.9.2 the button to enable javascript is missing

    I am having a problem with the BBC iPlayer playing in a separate pop-out player. Their support people have asked me to check that javascript running is enabled. In the Preferences content tab there is no button to enable Javascript, in fact the Prefe

  • Iweb/ computer to computer transfer/ publish error

    Problem with iWeb 09 and in particular publishing on my Blog. Today I decided to try and shift my iWeb site to a 2nd computer, from my iMac to my MacBook. Both have been installed up to date with all the latest software updates. I moved the domain.si