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:SmartWeb | Controller、路由、参数映射与服务器抽象 |
com.IceCreamQAQ.SmartWeb.Server:SmartHTTP | smart-http-server 实现 |
com.IceCreamQAQ.SmartWeb.Server:Undertow | Undertow 实现 |
com.IceCreamQAQ.SmartWeb.Temple:Rythm | Rythm 模板引擎集成 |
SmartWeb 当前源码版本为 1.0.0-DEV11,目标 JVM 8。它仍处于开发阶段,API 和依赖版本可能变化。