Forums Register Login

jspInit() method

+Pie Number of slices to send: Send
Is jspInit() method of a JSP equivalent of the init(ServletConfig) method of a servlet? Does is execute only once when the JSP is initialized?
I want to initialize a database connection pooling in my JSPs and wondering if this is a good place to do this.
Thx.
Ulvi.
+Pie Number of slices to send: Send
The jspInit() method is on the JspPage interface that must be implemented by servlet classes generated from JSP pages. These servlet classes are automatcically generated by the JSP Compiler on the Application Server so (AFAIK) you don't really have much controller over what gets placed in this method.
It sounds like you are trying to put too much logic and code into the JSP page. I would probably use another method to create you connection pool, maybe a servlet that is loaded on startup that then invokes a method on a class in the business tier that actually creates and manages the connection pool.
HTH
Andy
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 804 times.
Similar Threads
jspInit()
jspInit() or jsp_init()?
about jspInit
Question On jsp ,need help
Troll Detected
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:01:59.