Adding Dynamic parameters to Action Forward in struts

324 views
Skip to first unread message

sonyaks A

unread,
Nov 3, 2009, 12:34:36 AM11/3/09
to bo...@googlegroups.com
Hi  Frnds,

In Our Application , we have requirement like

1) add Dynamic parameters to Action Forward . We are using Struts 1.1.2 version and tiles

  I try to use following code

    actionForward.setPath(Mapping.findForward("success").getPath() +"?key1=" + value1);

     But Here Mapping.findForward("success")  which returns  path ( points to tiles Definition)

     After Appending the Key1 it not  finding  tile  definition .


Can you give any Suggestions


Regards


Kamesh.A




Alok Jain

unread,
Nov 3, 2009, 4:32:21 AM11/3/09
to bo...@googlegroups.com
U can write ur own custom request processor and intercept the request and put this parameter in request object ..... each request request will be intercepted by this processor ......... just read about request processor ......

look in to the below code snippet , it might can help u:
 public class CustomRequestProcessor extends RequestProcessor {
        @Override
    protected ActionForward processActionPerform(HttpServletRequest request,
                                                    HttpServletResponse response,
                                                    Action action,ActionForm formInstance,
                                                    ActionMapping actionMapping)
                                                    throws IOException, ServletException{
                //TODO write ur logic.. else call super method
     }
}

Thanks,
Alok Jain
Reply all
Reply to author
Forward
0 new messages