The front desk uses a form form of jQueryMobile, and then submits it to the Servlet for processing. The redirection of the response in the servlet cannot be used. After clicking submit on the mobile phone, the page displays the errorpage prompt text. After querying, it is said that ajax needs to be disabled. After I added data-ajax="false" to the form tag, the server reported an exception after submission.
Without adding data-ajax="false", the submitted content can be saved in the database, but the page will not jump. After adding it, the submitted data cannot even be saved in the database. I don't know if data-ajax= is added. "false", please give me some advice on whether to modify the Servlet, thank you very much!
Then just use ajax. Why am I so stupid? I solved it myself. .
$(document).ready(function () { $("#submitbtn").click(function(){ cache: false, $.ajax({ type: "POST", url: "feedback", data: $('#feedbackform').serialize(), success:function(data){ $.mobile.changePage("success.html"); } }); }); });