This is very coding specific question but still I’m going to use a bit of my coding experience in answering this question. Java web applications are used to create dynamic website. A website can be dynamic or static. A dynamic website is one on which the content keeps changing say for example a website which shows various stock prices whereas a website is static wherein the content on it does not change quite frequently an example here would be a Business website which displays its products and their rates.
Java provides support for web application through Servlets and Java Server Pages.
Website can be created with static HTML pages but when we want dynamic web pages we need a web application and then Java Web application comes into picture.
To keep the answer short, I would give an example of simple web application development with Servlet. Java Servlets are server-side Java program modules that process and answer client requests and implement the servlet interface.
In our example the application will allow user to add, update and delete all the user information. The application will on Apache Tomcat Server.
Step 1 Create a Home Page ("home.jsp") to view all the user. The home.jsp page queries data base to show all users in the system.
Step 2 Create a web page, “addUser.jsp" to add the new user to the system.
Step 3 Create a web page to, “editUser.jsp” to edit users in the system
Step 4 Create a web page to, “deleteUser.jsp” to delete user from the system
This flow of add, edit and delete user is an example of web application build via Java Server Pages. Not getting much into the coding details. I, hope this helps.