I have a java web application created in NetBeans from 'File-->New Project-->Java Web-->Web Application'.
I have Tomcat as the server. In my computer I can run php without any problem in a NetBeans php project, or in XAMPP.
But I want to run php commands in a java web application project. I tried by adding this code to index.jsp file
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<?php echo 'php code here'; ?>
<h1>Hello World!</h1>
</body>
</html>
It doesn't print 'php code here' string but print 'Hello World!' string.
I tried renaming file name index.jsp to index.php (And also change the name in web.xml file). But it still gives me the same output
Can anyone please tell me how to do this?
<?php ?>tags instead of<? ?>tags. The parser may be confused..jsppages as "may contain PHP code".