From: <php...@li...> - 2010-09-11 16:41:24
|
Hi - OK, I suspect this may be a bit off the beaten track, but thought I would ask anywise... I have set up a Tomcat server with the php-java-bridge servlets and support, tested and the examples all work fine, so I know the basic environment works.... Now I have a webapp, and it has a .jsp file that mostly contains javascript code, along with some jsp variables and of course some html code. Within one of the javascript sections I want to use a php script, and I am going to want to do some string substitutions from some of the jsp variables. That need seems to prevent me from incorporating the php script in a separate file. So the outline of the file is something like this - ---------------- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <%@ page import="java.io.*" %> <%@ page import="org.apache.commons.lang.*" %> <head> <% // JSP code here, for example - String url = request.getAttribute("URL").toString(); %> <script type="text/javascript"> // javascript code here... if (config.Manager) { with (config.Manager) { <?php require_once("java/Java.inc"); // <?php require_once("http://localhost:8086/mywebapp/java/Java.inc"); $IMConfig = array(); $IMConfig['images_dir'] = '<%= url%>/images'; // more php script here ?> } } </script> </head> <body> // html, javascript, jsp stuff here.... </body> </html> ------------- I have been fooling around with this, but so far it does not appear that I am getting the php script to execute. Can some kind soul help lead me to a solution? Thanks in advance... Marc... |