SV: How to create an include which calls an action: jsp:include page=some action Really need help : The Answer!
What I did is the following. I have a master jsp and in this jsp I inserted the following page. tile:insert controllerUrl=/viewNavigation.do page=/jsp/myJspPage.jsp/ Now there are two important things to consider. First in your action mapping definition in this case viewNavigation.do you must add the redirect=true to the foward attribute. If you do this, your navigation action does not need to return null, if you don't add this attribute, then your action must return null. The problem with the latter, is that you can't call this action (viewNavigation.do) in any other way than using the tile tag, because it will jus be a blank page. Here is my action mapping! action path=/viewNavigation scope=session name=someForm type=something.web.controller..ViewMultiNavigationAction forward name=success path=/jsp/myJspPage.jsp redirect=true / /action On my jsp page it looks like this Jsp start *** Bla bla Bla bla tile:insert controllerUrl=/viewNavigation.do page=/jsp/myJspPage.jsp/ Bla bla Bla bla Jsp end My action does not return null because of the redirect=true forward name=success path=/jsp/myJspPage.jsp redirect=true / Hope this helps Cheers Tommy -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sendt: 25. februar 2004 21:31 Til: Tommy Holm - TELMORE Emne: SV: How to create an include which calls an action I'm getting the following error. Can you send me an usage example. I wonder if controller action returns jsp to include why should we give page attribute again? tiles:insert page=/cap/capGeneralInfoAction.ecims flush=true /tiles:insert Thanks, Giri. Old message from Tommy ** No currently none of the proposed solutions worked. I am currently looking into the Tiles:insert tag Attributes are page = the jsp page to insert And most importantly there is an controller attribute which should be an action that perhaps prepares the jsp page. Just testing it now - HOLD ON - it works ... Check the tiles:insert tag Alternatively I figured another way to do it, it's very ugly though, you can jsp:include an action that just returns null.It does however set up the bean. Then right after this include on your master jsp, you call another jsp include that just includes a regular jsp, on this jsp you can reference The bean that the first include prepared and work as usual. I admitt the latter solution is very ugly, the tiles way seems to be the way to go! Cheers /Tommy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: How to create an include which calls an action
No currently none of the proposed solutions worked. I am currently looking into the Tiles:insert tag Attributes are page = the jsp page to insert And most importantly there is an controller attribute which should be an action that perhaps prepares the jsp page. Just testing it now - HOLD ON - it works ... Check the tiles:insert tag Alternatively I figured another way to do it, it's very ugly though, you can jsp:include an action that just returns null.It does however set up the bean. Then right after this include on your master jsp, you call another jsp include that just includes a regular jsp, on this jsp you can reference The bean that the first include prepared and work as usual. I admitt the latter solution is very ugly, the tiles way seems to be the way to go! Cheers -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sendt: 25. februar 2004 15:39 Til: Struts Users Mailing List Emne: Re: How to create an include which calls an action Did anyone figure out how to do this? Giri SENji. -Tommy Holm - TELMORE [EMAIL PROTECTED] wrote: - To: [EMAIL PROTECTED] From: Tommy Holm - TELMORE [EMAIL PROTECTED] Date: 02/23/2004 10:38AM Subject: How to create an include which calls an action Hi everyone. I have a problem, I have a jsp page which should include the result of an action call. The action should prepare the bean associated with the action and create the jsp which then in the end should be included in the master jsp.(The include is a menu, which the action should prepare). The problem is that after the include, the rest of the JSP page is not rendered. It does somehow make sense but is there anyway around this or a common strategy to achieve this. Any help is greatly appreciated. Cheers Kind regards Tommy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]