Giter Site home page Giter Site logo

latke-demo's Introduction

latke-demo

Latke 最小化示例,请结合文章 Latke 快速上手指南进行研究。

运行

  1. 编译:mvn install
  2. 启动:java -jar target/latke-demo.jar

打开浏览器访问 http://localhost:8080

数据库

本示例使用了内嵌的 H2 作为数据库,数据库文件默认路径为 ~/latke-h2-demo/db,如有需要请在 local.properties 中进行修改。

示例

模板页面渲染

  • 路径:/
  • 功能:渲染(输出 HTML)一个简单的 FreeMarker 页面模板
  • 代码:HelloProcessor.java 中 index 方法

表单处理

  • 路径:/greeting
  • 功能:渲染简单的表单以及处理表单提交
  • 代码:HelloProcessor.java 中 greeting 方法

ORM 持久化

  • 路径:/register
  • 功能:模拟用户注册并持久化数据
  • 代码:RegisterProcessor.java 中 showRegister 以及 register 方法

路径变量读取

  • 路径:/var/{pathVar}
  • 功能:读取路径变量
  • 代码:RegisterProcessorg.java 中 paraPathVar 方法

实际案例

  • Solo:一款小而美的 Java 开源博客系统,专为程序员设计
  • Symphony:一款用 Java 实现的现代化社区(论坛/BBS/社交网络/博客)平台

latke-demo's People

Contributors

88250 avatar yanxingangsun avatar zh-h avatar felayman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.