1. servlets (2 messages)

    i've written a servlet page which generates a html page that has 3 frames whose sources are also servlets.how to pass a Connection object between these pages?

    Threaded Messages (2)

  2. servlets[ Go to top ]

    If you mean you want to share the Connection object among the Servlets serving the three different pages, you could use HttpSession (with a key "known" to all Servlets). Not the best mechanism, but will do the trick.

    For a robust solution, you may want to read up on connection pooling
  3. servlets[ Go to top ]

    i think a better approach would be to create the connection in some sort of wiring up framework like spring (or just in one of the servlets) and then add it to ServletContext (also under a "key" that all servlets know) and then extract the Connection from ServletContext whenever u need to use it.