Skip to content

Full MVC Demo


JavaBean

Servlet

JSP Page

What’s happening?

  1. A browser sends a request to tomcat
  2. Tomcat parses the request header records and creates an HttpServletRequest object. The request object is then sent to the servlet.
  3. The servlet creates an instance of the BeanOne class. The data in this JavaBean is assigned with the set methods.
  4. The bean is added to the request object with the setAttribute() method.
  5. The servlet Forwards the same request object to the JSP page.
  6. The JSP page accesses the JavaBean and gets the data.
  7. The JSP page returns the response to the browser. The browser thinks the servlet sent the response.