#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    12
    Rep Power
    0

    Form post not working in apache tomcat


    my client using apache tomcat server in this server form post method not working but instead am using get method its working
    what the configuration am missing in web xml?
  2. #2
  3. Daniel Schildsky
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Mar 2004
    Location
    KL, Malaysia.
    Posts
    1,540
    Rep Power
    1621

    Strange behaviour


    First off, is the application deployed into Tomcat being implemented as servlets? If it is, are these servlets implementing the doPost() method?
    When the programming world turns decent, the real world will turn upside down.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    12
    Rep Power
    0
    Originally Posted by tvc3mye
    First off, is the application deployed into Tomcat being implemented as servlets? If it is, are these servlets implementing the doPost() method?
    am happy to see u r replay
    sorry

    here my code

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <form method="get" action="index1.html">
    <input type="text" name="test" />
    <input type="submit" id="btn" value="submit" />
    </form>
    </body>
    </html>



    when i try to submit button server said
    Error code: 405

    Error: Method Not Allowed

    error please help
  6. #4
  7. Daniel Schildsky
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Mar 2004
    Location
    KL, Malaysia.
    Posts
    1,540
    Rep Power
    1621

    need back-end code


    Could you post your back-end codes? See if there is anything which hinders the processing of POST data?
    When the programming world turns decent, the real world will turn upside down.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    12
    Rep Power
    0
    Originally Posted by tvc3mye
    Could you post your back-end codes? See if there is anything which hinders the processing of POST data?

    this post page also not working in my server

    its return
    405 server error

    this is test site before create a new website in client server

    before every project we test the client server with minimum pages like this when i try to post this page i got

    error
  10. #6
  11. Daniel Schildsky
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Mar 2004
    Location
    KL, Malaysia.
    Posts
    1,540
    Rep Power
    1621

    Mininum pages?


    Even with the minimum pages, your server MUST have a handler to handle the POST/GET data you submitted from the HTML page. What is handling your HTML form submission at index1.html ?
    When the programming world turns decent, the real world will turn upside down.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    12
    Rep Power
    0
    Originally Posted by tvc3mye
    Even with the minimum pages, your server MUST have a handler to handle the POST/GET data you submitted from the HTML page. What is handling your HTML form submission at index1.html ?
    this is index1.html page

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    page1
    </body>
    </html>
    which time u available we will get quick post and response
    one more thing check u r mail id sent a message to u r mail id[tvc3@hotmail.com]
  14. #8
  15. Daniel Schildsky
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Mar 2004
    Location
    KL, Malaysia.
    Posts
    1,540
    Rep Power
    1621

    Posting to a static HTML


    Since you said in your email to me that you have .NET programming experience, you should know well about client-server architecture. In .NET, form posts from client-end are handled by ASP.NET pages you developed. Likewise in Java.

    If I am correct, posting your form to a static HTML page will trigger the HTTP 405 error, since it is a static page, unable to handle and process the requests posted by your form. I personally have not tried posting to a static HTML before, so to some other Java programmers, correct me if I'm wrong.

    Anyhow, why not you directly deploy a plain-dead simple HelloWorld jsp or a servlet doing equivalent to the apache tomcat? If it returns with the expected message, then you may proceed further with the development phase.
    When the programming world turns decent, the real world will turn upside down.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    12
    Rep Power
    0
    hi

    i sent u the war file in mail plzz verify and advice me

    sorry for 2 way communication i hope this time u find out what am wrong?
  18. #10
  19. Daniel Schildsky
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Mar 2004
    Location
    KL, Malaysia.
    Posts
    1,540
    Rep Power
    1621

    Delayed reply


    I'll be cracking my head working on my project now, it's super critical at the moment and can be said that it's on fire now. It may take some time before I can get back to you.

    Meanwhile, why don't you google for some stuff on Apache Tomcat and try to configure a test JSP page for your form POST test? See if it works.
    Last edited by tvc3mye; August 6th, 2012 at 06:09 AM.
    When the programming world turns decent, the real world will turn upside down.
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    12
    Rep Power
    0
    Originally Posted by tvc3mye
    I'll be cracking my head working on my project now, it's super critical at the moment and can be said that it's on fire now. It may take some time before I can get back to you.

    Meanwhile, why don't you google for some stuff on Apache Tomcat and try to configure a test JSP page for your form POST test? See if it works.

    oh sorry for distrubed ill check
  22. #12
  23. Daniel Schildsky
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Mar 2004
    Location
    KL, Malaysia.
    Posts
    1,540
    Rep Power
    1621

    Check servlet url mapping settings


    Try check your URL pattern configuration for your servlet. See if it is correct.
    When the programming world turns decent, the real world will turn upside down.

IMN logo majestic logo threadwatch logo seochat tools logo