You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Leslie Bertels (Synergetic)" <le...@synergetic-solutions.be> on 2002/09/04 10:51:57 UTC

Action Chaining - Error 500 - Cannot find bean relations in any scope

Hi all,

I'm trying to chain several actions but this Error pops up.

I've got two pages:

timesheet.jsp with a button to find all the detail recs for that month.
detail.jsp with all the detail recs and for every rec a link to delete it.

So that means that both timesheet.jsp and detail.jsp need to go to detail.jsp.

I created three Action:
    1) FindRecAction
    2) DeleteRecAction
    3) RefreshRecAction


  <form-bean name="findRecForm" type="be.timesheet.actionforms.FindTSForm" />
  <form-bean name="delRecForm" type="be.timesheet.actionforms.ModifyTSForm" />
  <form-bean name="refreshRecForm" type="be.timesheet.actionforms.ModifyTSForm" />

Both the del and refresh use the same FormBean which holds the data for detail records.

I created some actionmappings with the chaining
    
<action path="/findRecs"  type="be.timesheet.actionforms.TimeSheetAction"
                                      name="findRecForm"
                                      scope="request"
                                      input="/timesheet/find_ts.jsp"
                                      unknown="false"
                                      validate="true">
           <forward name="success" path="/refreshTS.do"/>
</action>

        Input jsp = find_ts.jsp
        This action gets an userId from the request and puts an UserObj on the session that contains a TSnumber.
        I chain this action with the refreshTS because that is the Action that uses a TSNumber to retrieve all the records and puts this ArrayList on the session.

<action path="/delRec"  type="be.timesheet.actionforms.DeleteTimeSheetAction"
                                               name="delRecForm"
                                               scope="request"
                                               input="/timesheet/detail.jsp"
                                               unknown="false"
                                               validate="true">
            <forward name="success" path="/refreshTS.do"/>
</action>

        Input jsp = detail.jsp
        This Action uses the TSrecID to delete the rec from the database. Ofcourse I want to refresh the list. So I
        chain this action again with the refreshTS to retrieve once again all the records.


<action path="/refreshTS"  type="be.timesheet.actionforms.RefreshTimeSheetAction"
                                               name="refreshRecForm"
                                               scope="request"
                                               input="/timesheet/detail.jsp"
                                               unknown="false"
                                               validate="true">
            <forward name="success" path="/refreshTS.do"/>
</action>

            This action gets the TSnumber from the request and gets all the records and puts it as a ArrayList on the session.



So you see that I do not want to implement the same code twice or more. That's why I thought it would be a good idea to chain these actions and have 
the last one forward to a JSP to interprete the stuff on the session.

But as you will have understood, this does not work.
Anyone had the same problem???
Am I doing something wrond or should I do this in a totally different way??

Thanks in advance.

Regards,
Les.