在另一个jsp中包含与php中的概念相同的页面
使用下面php中的概念在jsp中添加页面在另一个jsp中包含与php中的概念相同的页面,php,jsp,Php,Jsp,使用下面php中的概念在jsp中添加页面 <?php $pg = @$_REQUEST['page']; if($pg != "" && file_exists(dirname(__FILE__)."/".$pg)) { require(dirname(__FILE__)."/".$pg); } elseif(!file_exists(dirname(__FILE__)."/".$pg))
<?php
$pg = @$_REQUEST['page'];
if($pg != "" && file_exists(dirname(__FILE__)."/".$pg)) {
require(dirname(__FILE__)."/".$pg);
} elseif(!file_exists(dirname(__FILE__)."/".$pg))
include_once(dirname(__FILE__)."../404.php");
else {
include_once("dash.php");
}
?>
如果您有解决方案,请提供帮助我已经找到了
假设你的答案如下:
解决办法如下
听说过谷歌吗?
<%
String abc=request.getParameter("page"), msg="";
// String path = request.getContextPath();
if (abc!=null)
{
%>
<jsp:include page="<%="includes/"+abc %>"/>
<%
}
else if(abc==null)
{
%>
<jsp:include page="<%="includes/"+p+".jsp"%>"/>
<%
}
else{
%>
<jsp:include page="<%="includes/404.jsp"%>"/>
<% }
%>