Hi all, Can anyone please reply to a small problem that i've got. How can i reference a JSP in B.war from a my struts application A.war? Is it possible to do it either through forward tag in struts-config.xml or in the action class where we use requestDispatcher(). If we're going to use requestDispatch(), how can i get the "servlet context" of the B.war. please help. venkat
There are two basic methods to switching from one module to another. You can either use a forward (global or local) and specify the contextRelative attribute with a value of true, or you can use the built-in org.apache.struts.actions.SwitchAction. Here's an example of a global forward:
Thanks Marc for your suggestion. I looked into the document and made the appropriate changes but to my misery it still didnt work. Let me explain to you through an example so that you can provide me with some suggestion of what I'm doing wrong here. I've this "testweb" and "changepass" modules in my WSAD. Both are different web-apps but run on the same server WAS5.0 Now in the "testweb" module when the forward is "success", it has to get redirected to "changepass.do" but thats not happening. The browser is returning me with an error "Invalid path" My struts config file for "testweb" module is as shown below: <forward name="success" contextRelative="true" path="/ChangePasswordWeb/changepass.do" redirect="true"/> Can you provide me with any suggestions?? Thanks for your help venkat
Sorry to trouble you guys I think I solved that. But theres one tiny problem I want to send the request object of "testweb" to the "changepass" web module. But the problem is i'm getting the value of this as null. Is there are specific way pass the request object from one web-app to another web-app? venkat
I replied to this yesterday but I do not see my post here now. Try putting your object(s) in session. The redirect should only cause you to lose request because the redirect is making two requests and the first request does not pass anything to the second. I do not believe you should lose session. You can remove your object(s) from session when they are no longer needed.
Thanks for your reply Marc, But the problem if i use session to pass around values is that The other application (B.war) is expecting data to retrieved from a request object and NOT a session object. I cant change the code in that application so somehow I should only pass the request object to that app. B.war is expecting request.getAttribute(...) and NOT session.getAttribute(...) Hope I explained my problem clearly, Thanks, venkat