views:

106

answers:

2

I have a bit of an issue with a site I maintain. I have been asked to add a report to a page that sits in a jsp page. The reporting information comes from a MySQL database. The problem is to connect the jsp to the database would require added functions to code that I do not have the original source of. I thought about redoing all the db connection again but thats a lot of time for something that will probably be rewritten in 3 weeks.

Then I thought of just using PHP to display the report in the jsp as I have other pages connecting to the database using php (long story as to why were are using 2 languages). But the only way I know of is by using iFrames which is a bit of a no no. Using the object tag I've seen also has errors in IE.

What would be the best way to do this?

+1  A: 

You can use the JSTL

   <c:import url="report.php"/>

to include the results of executing the PHP page.

Vincent Ramdhanie
I can't seem to get that to work. I've placed that in a div tag and have report.php just echo "test" but nothing happens. If I put a <% around it it dies.
Rudiger
Although this should work looking at other posts I couldn't get it to work and instead used iFrames.
Rudiger
A: 
<script language="php">
include_once ('report.php');
</script>
Brant
Please make sure your application server allows PHP
Brant