1

I have a situation where I am pulling in content from a CMS into spring webapp. Now we want to give the author in CMS an option to add or remove the spring app header and footer on the html served by the apache. This decision should be done on the server based on the setting done on CMS. We decided to use Server side includes to do the decision.Now the tricky part is how do I make the apache server ignore some of the server side includes and process the rest based on the CMS setting. code is similar to the following


< ! -- #include virtual="/webApp/globalHeaderWrapper" -- >

CMS data goes in here.

< !-- #include virtual="/webApp/globalFooterWrapper" -- >

1 Answers1

0

Set an environment variable and use a conditional include:

<!--#if expr="$CMSHEADER = /^true$/" -->
  <!--#include virtual="/webApp/globalHeaderWrapper" -->
<!--#endif -->
Community
  • 1
  • 1
Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265