Requests:
Please only answer if you know implications in depth.
Related Question that I found help from: Nested expression in JSP/JSTL
I want to make my links, paths, and variables (for images, scripts, and other pages and includes) generic so that refactoring or changes file locations in future would make no big problems.
What I thought was to make:
variables.jsp:
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<c:set var="mainDir" value="${pageContext.request.contextPath}/view/jsp" />
<c:set var="resourcesDir" value="${mainDir}/resources" />
header.jsp
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@include file="variables.jsp" %>
<html>
<head><title>${pageTitle}</title></head>
login.jsp
<c:set var="pageTitle" >
<spring:message code="pageTitle.login" />
</c:set>
<%@include file="${mainDir}/common/header.jsp" %>
<body>...
...
...
<%@include file="${mainDir}/common/footer.jsp" %>
Please observe the includes and c:sets / c:outs with spring:messages.
What is the proper way to do what I want to (if my current strategy is not sane).