I have three web applications deployed on the same Tomcat named
WebappParent, WebappClild1, WebappChild2.
Here WebappParent will get the username & password validates that and based upon the previlege it will call a particular servlet in WebappChild1 (or) WebappChild2 using URLConnection and "POST" method
But here i want to know how to pass the request object which i had received from the browser to WebappParent and from there to either of the child application.
I tried this using "GET" method and passing parameters along with the URL and it worked perfectly.
Thanks in advance
You can create a web application common repository and put that in shared/lib folder so that it can be shared across web application.
You can have the respository as singleton and should work like map interface(key:value).Now store the object in the respository in one application and send the key of that to the other application.
i know how to achive that with a single application but that's not my requirement.
What i think was if we have a way to request for a particular resource in a web application using URLConnection then there should be a way to pass request parameters & attributes too.
Originally posted by D Rog:
POST isn't more complex. When you opened URL connection just obtain output stream and write parameter pairs '&' separated. You may need to URL encode them though. If you need to convert GET to POST you can just write query string directly.
Raj Kumar is talking about passing object , rather the request object.
From the browser to WebappParent i received two values username & password as a "POST" method which after validation i just need to pass over to either WebappChild1 (or) WebappChild2.
With Pass over means the WebappChild which receives the call for request should do the processing as if it had received that from a browser (i.e. it should use request.getParameter("username")) to get the values.