• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Problem with forward in the struts-config.xml-File

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you accessing the records in the jsp file?

It doesn't seem like your action mappings are the problem. Please post jsp and action code (if applicable).
 
Michael Ernst
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The interesting JSP-Code:

The Form Bean


The action class:


[ August 15, 2005: Message edited by: Michael Ernst ]
[ August 15, 2005: Message edited by: Michael Ernst ]
 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Michael Ernst
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I put some simple Code in front of the setting of ActionForm.

But I get no output. The exectute method is never executed but why?

Regards
Michael
[ August 15, 2005: Message edited by: Michael Ernst ]
 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you accessing through the action servlet? (i.e with request to uri /admin/logged/showAdmin.do )

Have you overriden the validate method int the form to return errors?

These are the only reasons that I can think of.
 
Michael Ernst
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.


Regards
Michael
 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Upon further review, these actions seem to be pretty similar. Maybe you should create a DispatchAction.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic