开发者

JSP load external php not using iFrames

开发者 https://www.devze.com 2022-12-26 20:07 出处:网络
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 t

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 p开发者_JS百科ages 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?


You can use the JSTL

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

to include the results of executing the PHP page.


<script language="php">
include_once ('report.php');
</script>
0

精彩评论

暂无评论...
验证码 换一张
取 消