From: <php...@li...> - 2006-09-15 20:09:50
|
Hi, I am looking at using the PHP Java Bridge to help to transfer a whole lot of JSP pages into a PHP-based CMS. Installation went fine. The JSP pages are well structured with a set of java classes as a backend, such that the JSP page basically has to call a method with the HttpServletRequest request object as argument, and returns arrays of data to display on the page. Therefore it doesn't seem too difficult to imagine making a PHP module/class which simply calls the same java method via the PHP Java Bridge, then does the layout pretty much like the JSP file used to. HOWEVER the first stumbling block is that because we're no longer operating in a JSP sort of context, we don't appear to have an HttpServletRequest to pass to the backend any more, which we require to get hold of the URL string, cookies, etc. I'm not keen (at this stage) on reprogramming all the java classes to use an alternative source of input data, if it would be possible to get hold of a HttpServletRequest that we can pass in as before. I had a look at creating one programmatically (faking it), but it's not a class but an interface, and there are potentially some issues with session ids etc that I don't know about. Is it clear what I am trying to achieve? Does anyone have any hints for how to create a HttpServletRequest, get hold of one, or otherwise pass URI/cookie/session data through to our backend, that is used to receiving HttpServletRequest objects? Many thanks, Stephen Brandon |