sendRedirect/RequestDispatcher not working
posted 2 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I have a problem with my servlet that inserts data into the database. I have an HTML form with the POST method that sends the data to the servlet, which in turn inserts the data and redirects to a different form. I have tried using the sendRedirect and RequestDispatcher functions, but it didn't work. When I tried to display an error message in the catch block, it jumps directly to that part. When I remove the redirects and just display a message that the data has been inserted, it works fine. However, as soon as I add the redirect, everything starts to malfunction. I have the necessary libraries since I have already used select and delete queries, and they worked without any issues. What should I do?
Here is my servlet that inserts data into the database:
and here is my JSP page:
Here is my servlet that inserts data into the database:
and here is my JSP page:
posted 2 years ago
-
2 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
Perhaps it could be useful to include the error that the catch block is showing?
maria sirine
Greenhorn
Posts: 2
posted 2 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Bear Bibeault wrote:Perhaps it could be useful to include the error that the catch block is showing?
It shows nothing just a white page instaed of the next form where it should be redirected
posted 2 years ago
This will be printing the error to your console or to (assuming tomcat). Without it, there's only wild guessing possible.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
This will be printing the error to your console or to (assuming tomcat). Without it, there's only wild guessing possible.
| Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |













