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]

Reply via email to