Hello,
I'm building a site that includes a dynamic header file based on who the
visitor was referred by. I'm currently including the header as follows:
<% if (referred_by != null && referred_by.equals("ClientA")) { %>
<%@ include file="ClientA/clienta-siteheader.html" %>
<% } else if (referred_by != null && referred_by.equals("ClientB")) { %>
<%@ include file="ClientB/clientb-siteheader.html" %>
<% } %>
The site currently has over 100 JSPs and this will obviously become
cumbersome as more pages and referral sources get added. What I'd like to be
able to do is:
<%@ include file="<%= ub.getSiteHeader(referred_by) %>" %>
However, this returns a JSP Parse error. I realize I could use the following
bit of code instead but my include file contains java code that needs to be
translated and the jsp include tag just outputs the literal text contained
in the returned file:
<jsp:include page="<%= ub.getSiteHeader(referred_by) %>" flush="true" />
Have any of you implemented something similar to this and have a better
workaround than just adding multiple if statements as you need to check for
additional conditions? Any tips or pointers in the right direction would be
greatly appreciated!
Thanks,
Peter
[EMAIL PROTECTED]
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets