简体   繁体   English

JSP中C ++的“ #ifdef #endif”宏等效于什么?

[英]What's the equivalent of C++'s “#ifdef #endif” macro in JSP?

What's the equivalent of C++'s #ifdef #endif macro in JSP? JSP中C ++的#ifdef #endif宏等效什么? Is there such thing in JSP? JSP中有这种东西吗?

I want to conditionally include files in one JSP or another. 我想有条件地在一个JSP或另一个JSP中包含文件。 Reason for doing that is because I have a nested setup (nested jquery ui tabs). 这样做的原因是因为我有一个嵌套设置(嵌套的jQuery UI标签)。 I prefer to include files in the outermost layer for the "release" version. 我更喜欢在“发行”版本的最外层包含文件。 But for the "debug" version, I prefer to include file in the inner layers so I can debug individual pages. 但是对于“调试”版本,我更喜欢在内层包含文件,以便可以调试各个页面。 I'm using <%@ include ... %> to include files. 我正在使用<%@ include ... %>包含文件。

If it's possible, how would you implement that? 如果可能,您将如何实施? I think JSP include action ( <jsp:include> ) would work, but that's probably slower than JSP include directives. 我认为JSP include操作( <jsp:include> )可以工作,但这可能比JSP include指令要慢。

Thanks. 谢谢。

There is no direct equivalent. 没有直接的对等物。 Check this thread. 检查线程。 And probably this can shed some light as well. 也许也可以说明一些问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM