You work with hierarchies of components and design your application as such.
Unless you output HTML directly from your Java code you still need to learn another major technology JSP plus custom tag libraries in order to produce output HTML pages.
A very clean object-oriented and component based approach.