Skip to main content

Posts

Showing posts from February, 2013

Code segments about JSTL

<c:set var="myuri" value="${pageContext.request.contextPath}" />

 <c:choose>
        <c:when test="${fn:contains(myuri, '/xxx')}">
            <script type="text/javascript" src="javascript/xxx.js"></script>
        </c:when>
        <c:otherwise>
            <script type="text/javascript" src="xxx.js"></script>
        </c:otherwise>
    </c:choose>

Struts2 + FreeMarker Tempalte (FTL)

Struts2 + FreeMarker Tempalte (FTL) Integration exampleBy  on August 28, 2012 Welcome to Freemarker Tutorial Series. In previous post we created Spring MVC based Hello World Freemarker Template example. We learned few APIs of freemarker and also how to integrate it with Spring MVC based application. Following are the list of tutorials from Freemarker tutorial series. FreeMarker Tutorial SeriesPart 1: Introduction to Freemarker TemplatesPart 2: Freemarker Hello World examplePart 3: Freemarker + Servlet Integration tutorialPart 4: Freemarker + Spring MVC Integration tutorialPart 5: Freemarker + Struts2 Integration tutorial Today we will create a Struts2 based application that uses Freemarker FTL as view instead of JSP. This would give you a good insight in Struts2 + Freemarker integration. The application is similar to previous tutorial’s User app, where a list of users will be displayed and we can add new user. The application is very simple: