Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Tomcat Problem??

  • 20-03-2003 3:32pm
    #1
    Closed Accounts Posts: 5


    Hi,
    Im getting this error:
    HTTP Status 405 HTTP Method POST is not supported by this URL

    Im trying to run a small JavaMail program from tomcat
    I have the servlet included in the web.xml file
    <servlet>
    ..
    ..
    </servlet>

    <servlet-mapping>
    ..
    ..
    </servlet-mapping>

    Im running many other servlets with the same authority constraints and they work fine. For some reason this servlet wont
    Any ideas??
    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Post the servlet code and the code of whatever is calling it.

    Whats happening is whatever is calling the servlet is using a HTTP Post request to do so, your servlet doesn't support this.


  • Closed Accounts Posts: 5 james_mcgovern


    This is the code
    note: I have tried it with POST and doPost
    the html part is at the bottom of the file


  • Closed Accounts Posts: 202 ✭✭DSLinAbsentia


    The act of simply accessing a servlet from a URL (i.e., http://host/servlet/MyServlet, issues a GET request to that servlet.

    If you're trying to sent data from a form using the GET method, then you need something like this...

    <form method="GET" action="/servlet/MyServlet">
    blah blah
    </form>

    alternatively, if you want your servlet to cover the GET & POST methods, then simply add the following to your servlet class


    public void doPost (HttpServletRequest req, HttpServletResponse res) {
    doGet (req, res);
    }

    Now whatever way your servlet is called it will behave.

    Hope this helps.


Advertisement