You really need a book or tutorial to cover all the details, but in a few sentences, the process is:
You compile the Bean code separately and place the class file under WEB-INF\classes for the application, just like you would for a
servlet.
In the JSP you then refer to the bean with a
<jsp:useBean class="my.package.MyBean"
etc. style tag. The JSP compiler understands this syntax and compiles the JSP page into a servlet when the JSP page is addressed by a browser. You MUST put the bean code in a package.
Bill