Full MVC Demo
JavaBean
Servlet
JSP Page
What’s happening?

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