Sometime we need to use EJB from a JSP page. Its easy as shown in the example below:

EJB constructor (with parameter)
Java Code:
<%
    com.company.MyBean bean=new com.company.MyBean(1, 2, 3, 4);
    session.putAttribute("myBean", bean);
%>
EJB constructor (no parameter)
Java Code:
<jsp:useBean id="myBean" scope="session" class="com.company.MyBean"/>