Answer the question
In order to leave comments, you need to log in
How to output a servlet to java differently?
I study servlets in java, usually when you click on the submit button, it goes from the main page to another page, where the output of the result of the servlet's work is shown, the question is:
How to make the servlet output be on the main page, for example, under the same submit button?
Answer the question
In order to leave comments, you need to log in
There are several options:
- do not send to another page, but return the same one, specify the same page in the form
- use javascript and onclick on the button, send the form result via javascript
- the same as above, but use json as the format communication with the servlet.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question