System.out.println("Please enter password:");
passwordConfirm = scanner3.nextLine();
} while (!passwordConfirm.equals(password));
System.out.println("Your password has been confirmed");
will keep asking for password until the correct one is provided.
If you want only a fixed number of tries, you may have to declare a counter variable, increased in the loop, and tested in the while statement.
"I'm neither for nor against, on the contrary." John Middle
I'm doing hibernate web app from this tutorial: https://www.javatpoi...-with-hibernate and when I run url http://localhost:8181/register/ I get 404 error. Files are like in tutorial.
Project structure looks like this: click
Might want to clarify that other answer however since it actually depends on what the server is running.
A 'server' with java often means a JEE container. And most if not all of them have management APIs that allows access to usage statistics. So something like Tomcat, JBoss, WebLogic, etc might already have a way to get it via a http server or an API.