I have a JSP with some fields. When I fill in the fields and click the send button, I have to go check that the data in database exists; if it does not, I display a popup alerting the user that the data does not exist in the database. If they choose to continue anyway it goes on the screen; if not it returns to the starting point.
I’m stuck at where I display the popup, since the server can not display the popup on the client
Just let Servlet store the condition in request scope and let JSP print the Javascript code conditionally.
Servlet:
JSP (using JSTL):