Skip to content

SmartWeb

SmartWeb 是基于 Rain 的 JVM Web 后端框架。Rain 负责依赖注入、配置、事件和应用生命周期,SmartWeb 负责把 Controller 转换为可由 HTTP 服务器执行的路由。

能力

  • 使用 @WebController 声明控制器。
  • 使用 @GetAction@PostAction 等注解声明路由和请求方法。
  • 映射路径变量、请求参数、请求体、Session、Cookie 与上下文值。
  • 支持文件上传、文件响应和自定义渲染。
  • 使用 @NewWs 注册 WebSocket Action。
  • 支持多个命名 Web Server,服务器实现可替换。
  • 内置 SmartHTTP 与 Undertow 适配模块,以及 Rythm 模板引擎模块。

模块

Artifact作用
com.IceCreamQAQ.SmartWeb:SmartWebController、路由、参数映射与服务器抽象
com.IceCreamQAQ.SmartWeb.Server:SmartHTTPsmart-http-server 实现
com.IceCreamQAQ.SmartWeb.Server:UndertowUndertow 实现
com.IceCreamQAQ.SmartWeb.Temple:RythmRythm 模板引擎集成

SmartWeb 当前源码版本为 1.0.0-DEV11,目标 JVM 8。它仍处于开发阶段,API 和依赖版本可能变化。

阅读路线

  1. 快速开始
  2. 路由与控制器
  3. 请求与参数绑定
  4. 响应与渲染
  5. Before / After / Catch 过程链
  6. WebSocket
  7. 与 Spring MVC 对照
  8. 服务器与配置

基于 Apache License 2.0 发布