Every web framework for java is built on JEE core web technolgies i.e Servlets and JSP.
So learn Servlets and JSP properly before learning EJB.
The learning curve would be enjoying if you start with JSE( java core which covers JDBC,RMI), Servlets,JSP and then EJB.
Happy Learning. All the Best.