Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
其中哪一个更好<;c:进口>;及<;jsp:include>;在性能方面?_Jsp_Jstl - Fatal编程技术网

其中哪一个更好<;c:进口>;及<;jsp:include>;在性能方面?

其中哪一个更好<;c:进口>;及<;jsp:include>;在性能方面?,jsp,jstl,Jsp,Jstl,我正在使用importjstl标记,使用jsp:include而不是import是否更好 <c:choose> <c:when test="${item.id=='masters'}"> <c:import url="/newclickmenu/mastermenuitems.jsp"></c:import> </c:when> <c:when test="${

我正在使用importjstl标记,使用jsp:include而不是import是否更好

<c:choose>      
    <c:when test="${item.id=='masters'}">    
        <c:import url="/newclickmenu/mastermenuitems.jsp"></c:import>    
    </c:when>

    <c:when test="${item.id=='sales'}">   
        <c:import url="/newclickmenu/salesmenuitems.jsp"></c:import>   
    </c:when>
</c:choose>     

将在
之外提供灵活性和功能改进

  • 将允许您指定来自其他web应用程序、上下文以及web服务器的内容;这给了你更多的灵活性

  • 但是请记住,静态include总是比动态include快;意思 那
    都快

  • 从技术上讲,
    只应在您需要其功能或灵活性时使用,性能的改善是最小的

  • 有些人可能会说,如果您不需要实现
    ,因为它比
    更重,那么实现
    是不好的做法


c:import的一个重要优点是,它可以像当前上下文中的其他web应用程序一样包含外部资源。

可以访问web-INF文件夹中的页面吗?是的,正如我上面的代码,我正在从war文件夹导入它们。@M.S.Naidu抱歉,进行编辑;我觉得写评论太过分了。