passing parameters to include files in JSP
843835Apr 17 2003 — edited Apr 17 2003Greetings,
We have built a webapp to power a corporate web site that makes use of page templates and then uses XML and XSL to load the appropriate navigation and content into these templates.
Every template page (we have 4) uses the include directive to include a globals.jsp file containing constants that are used throughout the site:
<%@ include file="includes/jsp/globals.jsp" %>
The actual content (text) for each page is brought into the template using the include action:
<jsp:include page="<%= contentPath+contentPath1+pageDefaultExt %>" />
I need to be able to access variables set in globals.jsp from within the content of the page. For example, one of these globals is the tech support phone number (named techSupportPhone in globals.jsp). So in the content include file customercenter.jsp, there may be line that reads
" . . . or to contact us by phone, please call <%= techSupportPhone %>."
This results in a JSP execption saying that the variable cannot be resolved.
I tried explicitly passing this value to the included content file as such:
<jsp:include page="<%= contentPath+contentPath1+pageDefaultExt %>">
<jsp:param name="techSupportPhone" value="<%= techSupportPhone %>" />
</jsp:include>
and got the same results. Anyone know if any way that I can make this and other values avaialble to the included content file?
Thanks,
-d
PS - passing the values through the QueryString is not an option due to the larege amounts of info that will need to be made available - needs to be accessed fom the globals.jsp file