How can you check if a file exists before including/importing it in JSP?

前端 未结 2 1827
迷失自我
迷失自我 2020-12-17 14:47

Assuming that requestScope.importMe is expecting a path to a JSP file


    

        
2条回答
  •  抹茶落季
    2020-12-17 15:49

    @BalusC is quite clever, and probably answers the question.

    However, to be complete, nothing in the standard JSTL will do what you want, but you can certainly create your own EL functions that you can use to do the check. Obviously you'll need to write Java for it, but it's not inline within your JSPs.

    The J2EE 1.4 Tutorial has a section on creating your own EL functions.

提交回复
热议问题