Please Help!

In my Struts-Application I create at a certain point (init Method of
myClass extends ActionServlet) a Bean for the Servlet Context.

ServletContext context = getServletContext();
Info info = (Info)context.getAttribute("host");
if (info == null)
{
   info = new Info();
   info.setBase("test");
   context.setAttribute("host", info);
}

Later in a JSP page I have that:

<jsp:useBean id="info" scope="application" class="myPackages.Info"/>
<p>Context Bean: <bean:write name="info" scope="application"
property="base"/></p>

But I don't reach the value of the property because every time when I
forward to that JSP-Page the Bean (Info) is created again and it's
properties initialized with null.

Any idea?
What is wrong???

Hartmut Bernecker

Reply via email to