1

What's the equivalent of C++'s #ifdef #endif macro in JSP? Is there such thing in JSP?

I want to conditionally include files in one JSP or another. Reason for doing that is because I have a nested setup (nested jquery ui tabs). 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.

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.

Thanks.

Nano Taboada
  • 4,148
  • 11
  • 61
  • 89
ytw
  • 1,335
  • 2
  • 20
  • 42

1 Answers1

1

There is no direct equivalent. Check this thread. And probably this can shed some light as well.

Community
  • 1
  • 1
LordDoskias
  • 3,121
  • 3
  • 30
  • 44
  • Due to deprecation, the Apache link is now _approximately_ [this](http://svn.apache.org/repos/asf/jakarta/taglibs/deprecated/i18n/trunk/src/main/java/org/apache/taglibs/i18n/IfdefTag.java) (that's the source, but if you can't read that…) – Donal Fellows Feb 02 '22 at 15:06