What J2EE technology would you typically use to replace PHP scripts?
Applets
JSP
JSP/Servlets
JSP/Servlets and EJBs
You would never replace PHP scripts with a J2EE technology