Hi,
Unsuccessfully web browsing makes me come here.
I wonder if it's possible to create a bean (used by <jsp:use-bean>) on
startup, also through web.xml. I've seen it is possible to launch a
servlet with <load-on-startup> xml element, but, as I believe I've
understood, it is NOT a persistent object.
So, i'm asking if :
- is this possible to create a persistent object through a servlet
lauched at startup ?
- is there a different way ?
Regards,

Signature
Mounir
Mounir - 14 Aug 2006 16:00 GMT
Hi all,
It was very simple : I've created the bean through a loaded-on-startup
servlet, and added to the servlet context :
web.xml :
<servlet>
<servlet-name>aServlet</servlet-name>
<servlet-class>package.of.the.servlet.aServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet>
Source part of aServlet.init():
{
ServletContext context=getServletContext();
context.setAttribute("beaname",beanobjet);
}
And in jsp files :
<jsp:use-bean id="beaname" scope="application
class="package.of.the.bean.BeanObject"
type="package.of.the.bean.BeanObject"/>
(type is optionnal here)