javaBean and Servlet


Web tier: servlets, JSP, Web frameworks: javaBean and Servlet

  1. javaBean and Servlet (2 messages)

    could you give me the source code to instantiate a javaBean in the servlet in order to use the Bean later in an Java Server Page?
    in fact i create a servlet that must instanciate a javaBean and initialize their properties that they will be accessed by a JSP.


    Threaded Messages (2)

  2. javaBean and Servlet[ Go to top ]

    Hi anis,

    Calling EJb in servlet is as we do generally in client.

    In servlets init method you can create initial context and then do the lookup.
  3. javaBean and Servlet[ Go to top ]

    Hi anis, sorry for breaks. i pressesed reply accedently.

    So where we were.

    After doing lookup in init.

    you can code the calls to homeinterface and remoteinterface as we do in the normal java program. Only difference is that these will be in doGet() or doPost() method of the servlet.

    I hope it will help you. I will try to give you sample code tomorrow.