Is JSP part of the whole JEE/J2EE package? How are they related?
From my understanding JSP is a part of the J2EE "family", providing a frontend or web-based access to Java applications.
JEE is composed of web application, enterprise application and management/security components.
JSP (along with JavaServer Faces, Servlets, etc..) is a piece of JEEs' "Web Application Technology".
Java EE is a very big box. It includes:
- Servlets and JSPs for the web tier,
- EJBs - stateless and stateful session, entity, and message driven beans,
- RMI for Java-to-Java remoting (also part of Java SE),
- JDBC for relational database access (also part of Java SE),
- JMS for messaging,
- JTA for transaction monitoring,
- JNDI naming and directory services,
- Web services - SOAP, REST, RPC-XML,
- E-mail,
- Maybe others that I'm forgetting.
Plus containers that handle pooling, threading, lifecycle, etc.
As you can see, JSPs are just a small part of the larger whole.
You can accomplish a great deal with just a servlet/JSP engine (e.g., Tomcat or Jetty), servlets/JSPs, and JDBC. Any web app that exposes database CRUD via the web can be written with just these technologies.
J2EE is made up of many specifications. For example, J2EE 6.0 has spec links here: http://java.sun.com/javaee/technologies/javaee6.jsp
Some specifications can be implemented in non-J2EE containers, such as Tomcat webserver. So, they include jsps and servlets though they implement just a tiny bit of J2EE.
So, you can look at here for more about JSP. http://java.sun.com/products/jsp/
It is just a tiny part of the overall J2EE framework, but you don't have to use a J2EE container to use JSPs.
JSP has been part of JEE since the start, just after servlets came into being. JSPs are converted into java servlets (source code), then compiled into byte code before being used.
It would be interesting for you to take a look at the source code generated (if your container keeps the source).
A lot of frameworks use JSP as a basis for the 'view' part. JSF can uses Facelets instead of JSPs as a base.