In practice, you will almost never develop a web application on top of pure Java SE. Java SE itself is suitable for graphical desktop applications or text-based command-line utilities.
If you want to create a web application similar to the ones you also create, for example. PHP or RoR, the least used is the so-called Servlet container . They all run on top of Java SE and provide you with servlets and JSP pages from Java EE. Notable examples are Tomcat and Jetty.
However, most web applications require more than those Servlet containers offer. Almost always requires a web framework (e.g. JSF, Struts, Wicket, Tapestry, Spring MVC), some ORM framework (usually Hibernate, but there are some alternatives like EclipseLink) and a transaction manager (JoTM, JBossTS, Atomikos). Finally, most people also prefer to use a container for dependency injection and a higher level of transaction management (for example, the main container Spring, OpenEJB, Weld).
All this, however, requires developers to create and maintain their own software stack. All the different things that I mentioned need to be downloaded separately, and they may or may not be compatible with each other due to common dependencies in different versions.
It uses Java EE.
Java EE offers you a single infrastructure that gives you all of the above in one package. You can download it in one package and upgrade it in one package. As a rule, parts work better together than creating the stack yourself.
You can compare this a bit with downloading a full Linux distribution, such as Ubuntu, or create your own Linux system from scratch, starting from the kernel.
In the old days, Java EE (called J2EE at the time) was a heavyweight, expensive, closed source and ivory tower and managed by a vendor. Currently, Java EE is very lightweight, free, open source, and mainly based on what has been proven to work in practice.
Although for many Java EE implementations it considers that you are not paying (in terms of memory or startup time) for what you are not using, the current Java EE specification has defined a smaller "profile" of Java EE with all that is accepted that a typical web - the application does not need. This is called a web profile . There is no really compelling reason for the end users to explicitly opt for a web profile, but for the people creating the Java EE implementation, this is a huge win because it is much easier to implement.
Finally, almost all parts of Java EE are available separately, so you can also create your own stack entirely consisting of Java EE elements. This, however, is not so common, since there are very few advantages compared to using the existing Java EE implementation.