Instant FreeMarker Starter
暫譯: 即時 FreeMarker 入門指南

Charles Forsythe

  • 出版商: Packt Publishing
  • 出版日期: 2013-04-07
  • 售價: $1,020
  • 貴賓價: 9.5$969
  • 語言: 英文
  • 頁數: 64
  • 裝訂: Paperback
  • ISBN: 1782163824
  • ISBN-13: 9781782163824
  • 海外代購書籍(需單獨結帳)

相關主題

商品描述

Structure your enterprise-class projects with FreeMarker!

Overview

  • Learn something new in an Instant! A short, fast, focused guide delivering immediate results.
  • Build realistic enterprise projects on your own
  • Create your first template with FreeMarker
  • Learn how to integrate with the Struts2 and Spring frameworks

In Detail

Generating completed text documents by filling in blanks on a template is as old as printing, but this simple and straightforward approach to creating web pages and other computer-generated text using FreeMarker has only recently begun to gain popularity.

Instant FreeMarker Starter uses hands-on, real-world examples to show how to master its features, integrate with your web application framework, and effectively incorporate a template engine into your next enterprise project.

This guide gets you started quickly, showing you how you can begin using FreeMarker in less than a dozen lines of code. From there, it covers key features and shows you how FreeMarker integrates with popular MVC frameworks.

The core of the book walks you through the development of a program that generates a monthly newsletter from a complex data model. Along the way, you will learn strategies for organizing your FreeMarker logic in large enterprise projects. After covering the capabilities of FreeMarker, the book will show you how to integrate it with popular web application frameworks.

In short, the book will take your novice experience with FreeMarker to a level wherein you will create your own FreeMarker-based project.

What you will learn from this book

  • Load and process templates
  • How expressions access a data model
  • Create and use macros and functions
  • Control the formatting of different data types
  • Handle errors and missing data
  • Loop over repeating content
  • Control complexity by breaking templates into fragments and libraries
  • Regulate output with logical operations and conditionals
  • Use JUnit to test your templates
  • Integrate with frameworks such as Struts2 and Spring
  • Migrate from legacy JSP technology

Approach

Get to grips with a new technology, understand what it is and what it can do for you, and then get to work with the most important features and tasks.A simple Starter approach introducing new concepts and terms through the hands-on building of templates for Java APIs.

Who this book is written for

If you are a dynamic web developer or a Java-based apps developer new to FreeMarker, then this book will provide invaluable guidance to get your new project started on the right track. If you have started using FreeMarker and find it confusing or complicated, this book will be a guided tour that will show you how to conquer complexity and create a template-based view layer with an elegant architecture.

The book is also aimed at those who have elementary web development skills and basic Java programming knowledge. Readers should also have a conceptual understanding of the MVC model.

商品描述(中文翻譯)

使用 FreeMarker 組織您的企業級專案!

概述

  • 立即學習新知!一本短小、快速、專注的指南,提供即時結果。
  • 獨立建立真實的企業專案
  • 使用 FreeMarker 創建您的第一個模板
  • 學習如何與 Struts2 和 Spring 框架整合

詳細內容

透過填寫模板中的空白來生成完整的文本文件,這種方法與印刷一樣古老,但使用 FreeMarker 創建網頁和其他計算機生成文本的這種簡單直接的方法,直到最近才開始受到歡迎。

《Instant FreeMarker Starter》使用實際的案例來展示如何掌握其功能,與您的網頁應用框架整合,並有效地將模板引擎納入您的下一個企業專案。

本指南讓您快速入門,展示如何在不到十行代碼的情況下開始使用 FreeMarker。接下來,它涵蓋了關鍵功能,並展示了 FreeMarker 如何與流行的 MVC 框架整合。

本書的核心部分將引導您開發一個從複雜數據模型生成每月通訊的程序。在此過程中,您將學習如何在大型企業專案中組織您的 FreeMarker 邏輯。涵蓋 FreeMarker 的功能後,本書將展示如何將其與流行的網頁應用框架整合。

簡而言之,本書將使您對 FreeMarker 的初學者經驗提升到一個層次,讓您能夠創建自己的基於 FreeMarker 的專案。

您將從本書中學到什麼

  • 加載和處理模板
  • 表達式如何訪問數據模型
  • 創建和使用宏和函數
  • 控制不同數據類型的格式
  • 處理錯誤和缺失數據
  • 循環遍歷重複內容
  • 通過將模板拆分為片段和庫來控制複雜性
  • 使用邏輯運算和條件來調節輸出
  • 使用 JUnit 測試您的模板
  • 與 Struts2 和 Spring 等框架整合
  • 從舊版 JSP 技術遷移

方法

掌握一項新技術,了解它是什麼以及它能為您做什麼,然後開始使用最重要的功能和任務。這是一種簡單的入門方法,通過實際構建 Java API 的模板來介紹新概念和術語。

本書的讀者對象

如果您是一位動態網頁開發者或新接觸 FreeMarker 的 Java 應用開發者,那麼本書將提供寶貴的指導,幫助您將新專案正確啟動。如果您已經開始使用 FreeMarker,但覺得它令人困惑或複雜,本書將是一個指導之旅,將向您展示如何克服複雜性,並創建一個具有優雅架構的基於模板的視圖層。

本書也適合那些具備基本網頁開發技能和基本 Java 程式設計知識的讀者。讀者應該對 MVC 模型有概念性的理解。