JSP files generated by MD4J have various dependencies you have to take care of in your project. Most of these dependencies are located in the WAR/md4j-dep directory during runtime. This page documents the whole thing with examples where applicable.


MD4J-generated JSP files have Page Include Directives (i.e. compile time includes). You need to create those yourself based on your requirements. Sample files for use with Struts 1.x are provided below for your convinience, starting with

<!-- /md4j-dep/ for Struts 1.x -->
<html  xmlns="" xml:lang="${sessionScope['org.apache.struts.action.LOCALE']}" 
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<c:if test="${not empty pageScope.windowTitle}">
				<c:out value=" - ${pageScope.windowTitle}" />
		<style type="text/css" media="screen">
		    @import "<jsp:expression>request.getContextPath()</jsp:expression>/css/main.css";
		<div id="container">
			<!-- header begin-->
			<div id="header">
				<!-- header markup here -->
			<!-- header ends -->
			<!-- menu begins -->
			<div id="menu">
				<!-- menu markup here -->
			<!-- menu ends -->
			<!-- contet begins -->
			<div id="content">

for search pages, you need a

<!-- /md4j-dep/ for Struts 1.x -->
<c:if test="${requestScope.results.totalPageCount gt 1}">
    <p class="paging">
        <c:if test="${not empty requestScope.results.totalResultCount}">
            <c:out value="${requestScope.results.totalResultCount}" />
            <span><jsp:text> </jsp:text></span>
            <bean:message key="seach.results.matched.your.criteria"/>
            <span><jsp:text>: </jsp:text></span>
        <c:if test="${requestScope.results.pageNumber gt 1}">
            <jsp:text> </jsp:text>
            <a href="${pageScope.searchUrl}&amp;resultsPageNumber=1
                <bean:message key="first"/>
            <span><jsp:text> - </jsp:text></span>
        <c:if test="${requestScope.results.pageNumber gt 2}">
            <jsp:text> </jsp:text>
            <a href="${pageScope.searchUrl}&amp;resultsPageNumber=${requestScope.results.pageNumber-1}
                <bean:message key="previous"/>
            <span><jsp:text> - </jsp:text></span>
        <c:if test="${requestScope.results.pageNumber lt (requestScope.results.totalPageCount - 1)}">
            <jsp:text> </jsp:text>
            <a href="${pageScope.searchUrl}&amp;resultsPageNumber=${requestScope.results.pageNumber+1}
                <bean:message key="next"/>
            <span><jsp:text> - </jsp:text></span>
        <c:if test="${requestScope.results.pageNumber lt requestScope.results.totalPageCount}">
            <jsp:text> </jsp:text>
            <a href="${pageScope.searchUrl}&amp;resultsPageNumber=${requestScope.results.totalPageCount}
                <bean:message key="last"/>

and the last include is

            <!-- /md4j-dep/ for Struts 1.x -->
			<!-- contet ends -->
			<!-- footer begins -->
			<div id="footer">
				<!-- footer markup here -->
			<!-- footer ends -->
	    <!-- container ends -->


JSP files for use with Struts 1.x need the following as validator-static-js.jsp:

<?xml version="1.0" encoding="UTF-8"?>
<!-- /md4j-dep/validator-static-js.jsp for Struts 1.x -->
<jsp:root xmlns:jsp="" 
    < language="java" contentType="text/javascript; charset=utf-8"/>
    < session="false" />
	<html:javascript dynamicJavascript="false" staticJavascript="true"/>

Date Controls

By default MD4J JSPs use The DHTML Calendar by Mihai Bazon, licensed under the LGPL. Neat. This is used for date input in forms so you need to set it up:

  1. Download the thing
  2. Unarchive and, if needed, rename the distribution directory to "jscalendar"
  3. Drop the directory in /md4j-dep