Thank you Robert.
But, the mapping.getInputForward gives me an output like this:
reached here...failure
actionForward : ForwardConfig[name=null,path=null,redirect=false,contextRelative=false]

But, by giving two mappings in the struts-config, I was able to solve the probelm for 
the time
being. Instead of mapping.getInputForward, I am setting one more <forward name? for 
each action
mapping to handle the "failure" case.

I don't understand why the mapping.getInputForward returns null. Please let me know if 
u have any
clue.

Thanks for the idea!!!
Pramod



                                                                                       
                            
                    sem.Gottofrey@                                                     
                            
                    bkw-fmb.ch           To:     [EMAIL PROTECTED]                     
               
                                         cc:                                           
                            
                    06/27/2003           Subject:     AW: error handling               
                            
                    03:36 PM                                                           
                            
                    Please respond                                                     
                            
                    to "Struts                                                         
                            
                    Users Mailing                                                      
                            
                    List"                                                              
                            
                                                                                       
                            
                                                                                       
                            




Hi Pramod,

One solution would be to define two different action mapings as follows:

  <action
   path  = "/MyActionFromMyFirstJsp"
   type  = "mypackage.MyAction"
   name  = "myFormBean"
   scope = "session"
   input ="/pages/myFirst.jsp">
    <forward name="success" path="/pages/Result.jsp" />
  </action>

  <action
   path  = "/MyActionFromMySecondJsp"
   type  = "mypackage.MyAction"
   name  = "myFormBean"
   scope = "session"
   input ="/pages/mySecond.jsp">
    <forward name="success" path="/pages/Result.jsp" />
  </action>


   In your action you then use 'return mapping.getInputForward()' in case of
error.

HTH
Robert


> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Gesendet: Freitag, 27. Juni 2003 11:15
> An: Struts Users Mailing List
> Betreff: error handling
>
>
>  Hi,
>
>         Can anyone send me a solution for the following
> problem:
>  From two jsps, I am coming to the same action class. (in the
> first jsp, I have a link, clicking on
>  this will go to an action say MyAction. From the second jsp
> also, I can goto the same action
>  MyAction). In the MyAction class, how do I write code to
> return to the parent page when error
>  occurs. (I am catching error using ActionErrors)
>
>  <action
>    path          = "/MyAction"
>    type = "mypackage.MyAction"
>    name = "myFormBean"
>    scope         = "session">
>    <forward name="success" path="/pages/Result.jsp" />
>  </action>
>
>
>  Here, if the forward is success, i am able to got
> Result.jsp. But if any error is there, how do I
>  display the error in the parent page? (I can come to this
> action from two different parent page)
>  Please advise.
>
>
>  Thanks,
>
>
>  Pramod

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




********************************************
This  electronic  mail  message  is  intended  solely  for  the  named  recipients  
and  may contain
confidential  and  proprietary  business information of eFunds Corporation and all its 
subsidiaries.
If  you  are  not a named recipient, please notify the sender immediately.  You may 
not disclose the
contents  to  any  other  person;  use  this  electronic  mail message or its contents 
for any other
purpose; or further store or copy its contents in any medium
********************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to