From: <php...@li...> - 2010-09-12 10:41:31
|
Hi Marta, first of all, requestDispatcher.forward() lets you forward POST requests. But I don't think this works with include(). Second: some application servers like Sun Java AS 9 have a very small thread pool size. If you open a loop-back connection to the back end, you risk to lock up the whole application server. AS 9 pool size defaults to 5, which means that 3 concurrent user requests *will* lock up your application server forever, if your servlet opens a HTTP URL connection back to your application server. Apache's pool is larger, it defaults to MaxChilds=150. Send it more than 75 concurrent requests and it will stop responding forever. So file_get_contents(localURL) or a loopback java.net.URLConnection to the back end is not an option. Forget that. If your JSP has been written properly, it separates the business- from the UI logic. So it should be easy to call the business methods from your PHP servlet as well. If not, your only option is to refactor the JSP or to duplicate some of its functionality. A third option (but rather lo-tech) is to ask the browser to deliver the content of your JSP and to deliver it to your PHP servlet using AJAX. Regards, |