高级主题
错误处理
Register custom ErrorHandler implementations through the Java Service Provider Interface to respond to specific exceptions in webforJ apps.
生命周期监听器
Hook into webforJ app startup and shutdown phases with AppLifecycleListener to initialize services, modify config, or clean up resources.
Web 存储
Web storage 是 web 开发中的一个基本概念,它允许网站在客户端存储数据。这使得 web 应用能够在用户的浏览器中本地保存状态、偏好和其他信息。Web 存储提供了一种在页面重新加载和浏览器会话之间持久化数据的方法,减少了对服务器重复请求的需要,并支持离线功能。
区域设置管理
webforJ 提供内置支持来管理应用程序的区域设置。区域设置决定了整个应用使用的语言和区域格式。组件可以通过 LocaleObserver 接口对区域设置的变化做出反应,从而在用户切换语言时立即更新 UI。
翻译
Resolve localized strings from resource bundles or custom sources with the t() method, MessageFormat placeholders, and browser locale detection.
浏览器控制台
Log messages from Java to the browser console with typed levels and styled output using the BrowserConsole utility.
MaskDecorator
MaskDecorator 是一个静态工具类,用于在输入字段外对字符串、数字、日期和时间应用掩码。它使用与 webforJ 的 masked field components 相同的掩码语法,使得在展示标签、Table 渲染器或应用程序的任何其他位置一致地格式化和解析值变得简单明了。
间隔
类 Interval 代表一个定时器,它以固定的时间延迟触发一个 事件。
Debouncing
Delay actions until activity settles using the Debouncer class for search-as-you-type, autosave, and other rate-limited UI work.
浏览器历史
BrowserHistory 类在 webforJ 中提供了一个高层次的 API,用于与浏览器的历史记录进行交互。浏览器历史记录允许 web 应用程序跟踪用户在应用程序中的导航。通过使用浏览器历史记录,开发者可以启用诸如前进和后退导航、状态保留以及动态 URL 管理等功能,而无需进行完整页面重载。
页面可见性
Detect when the tab hosting your app moves between the foreground and the background, and react in Java.
地理位置
Request and watch the device's geographic position using the Geolocation class, with high-accuracy, timeout, and maximum age controls.
应用徽章
Paint notification badges onto the operating system app icon and the browser tab favicon.
Push Notifications
Use the Push class, PushSender, and PushMessage to subscribe browsers and send notifications from the server, even when the app isn't open.
命名空间
Share thread-safe key-value state across sessions, thread groups, or the entire JVM using Private, Group, and Global namespaces.