Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP with PHP  RSS feed

 
Raja Ghulam Rasool
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dont know if this is the right forum to post .. but still
I am working on a legacy application which uses a combination of php and jsp.
I have got the code of the application and the index.jsp page of that application has syntax of php written in it
<%
include( "../../a/xyz.jsp" );
include( "../../d/abc.php" );

%>
I have configured Apache to run PHP and JSP (with the help of Tomcat by using the mod_jk as a connector) but when I place the index.jsp in the tomcat ROOT directory and try to access through the Apache then I encounter syntax errors
and when i place the index.jsp in the htdocs directory of Apache 2.0.43 then page is not found. Please help me out with this one
Apache 2.0.43 , Tomcat 4.1 PHP 4
Thanks
RGR
 
Ben Dover
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why on earth would you want to do this? Are you trying to run the PHP code in your JSP page?
Firstly, AFAIK, the connector to your JSP simply routes requests for .jsp extensions to the servlet engine (ie Tomcat) to process the page and whoosh it back for presentation. If you have PHP syntax in the JSP page, Tomcat will have no idea what do do with it because Tomcat is not (yet?) a PHP (Zend) engine. Hence the JSP syntax erros.
The only way apache can tell what kind of page to process is by doc type. So, a JSP page is a JSP page, a PHP page is a PHP page. And gets treated accordingly. Think of apache as a router in a sense. HTML it processes, PHP is processed by the Zend engine, JSP by servlet engine. Never the twain shall meet. Who knows, maybe I can be proved wrong.
So now, let us know what are you trying to achieve exactly? Maybe there is a better way.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that in order to get that PHP content back to the JSP, you are going to have to create a HttpURLConnection addressing it so that Apache can pick it up, run the PHP and return content. Like Louis said - Tomcat is unable to understand that reference.
Bill
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!