Hello,
I'm working on my first struts application and everything went o.k. until
recently I get the following error :
javax.servlet.jsp.JspException: Cannot find bean products in scope request
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:708)
....etc...
But this page is working alright after I start the server. I can work the
whole day with the application, but the next morning I get this error.
I've tried it with resin 2.1.1, 2.1.2 and 2.1.3 and tomcat 4.0.4. Also with
struts 1.1.b1 and daily snapshot, but always the same.
Can anybody give me a little help ?
This is the code from the jsp file:
<logic:iterate id="element" name="products"
type="nl.linuxonline.shop.product.ProductBean" scope="request">
And this is the struts action:
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
HttpSession session = request.getSession(true);
ActionErrors errors = new ActionErrors();
MessageResources messages = getResources(request);
DataSource dataSource = null;
Connection myConn = null;
ProductJdbcBean proddb = new ProductJdbcBean();
String did = request.getParameter("did");
try {
dataSource = (DataSource)
servlet.getServletContext().getAttribute("shopdb");
myConn = dataSource.getConnection();
Vector MyProducts=proddb.getMyProducts(myConn,did);
ServletContext context = getServlet().getServletContext();
context.log("DID:"+did+"Aantal:"+MyProducts.size());
request.setAttribute("products",MyProducts);
} catch (SQLException sqle) {} finally {
try {
if (myConn !=null)
myConn.close();
} catch (SQLException e) {
System.out.println("Oooops:" + e);
}
}
request.setAttribute("did",did);
return mapping.findForward("forward");
}
}
Regards,
Edwin
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>