Hey, I have a little problem withd by understanding the forward element in the struts-config.xml-File. The problem: I have an overview side with diffrent record sets. Each record has an edit link. If the record will be successfully updated, I want to forward to the overview side but everytime I get an exception that no collection was found ([ServletException in:/jsp/admin/logged/showAdmin.jsp] No collection found'). Only If I make a forward direct to the *.do page the page will be loaded correctly.
[ August 15, 2005: Message edited by: Michael Ernst ] [ August 15, 2005: Message edited by: Michael Ernst ]
posted 15 years ago
Everything looks good to me, I would put some logging code to make sure the method, ShopSystemAdminPeer.doSelect(new Criteria()) is returning what you want it to return. Though, I do not have any experience with the nested tag library.
I don't know if the error generated is a result of a null value returned or maybe it cannot see the form at all. Is the property username output? If it is maybe you should initialize list to an empty collection in your form.
Are you accessing through the action servlet? (i.e with request to uri /admin/logged/showAdmin.do )
If I'm accessing through the showAdmin.do direcly or forward to the showAdmn.do, the page will be loaded correctly. Only If I'm accessing throung the jsp Page by forwarding, the code generates the error.
Have you overriden the validate method int the form to return errors?
Yes, the validate method is overridden.
posted 15 years ago
If you are forwarding to the tile from another Action the execute method will not be executed and your list will be null.
Otherwise, you cannot be taking about the forward from the current action, because that would require the execute method and thus the list will be populated.
Therefore, you must forward to the action from the processEditAdmin? action. [ August 15, 2005: Message edited by: Kerry Wilson ]