Siirry pääsisältöön

Production build for a Java web app: smaller, cacheable assets

· 6 minuuttia
Eric Handtke
Software Developer

cover image

Out of the box, a webforJ app needs no build tuning. The framework's own components and runtime ship ready for both development and production with no extra setup, so a plain webforJ app has nothing to minify and no build step to configure.

A production build for a Java web app only comes into play once you add your own assets: custom CSS, JavaScript, or npm packages. For those, mvn package compiles the frontend, puts a hash of each file's content into its filename, and minifies the CSS and JavaScript. Browsers download less, and they keep each file in cache until its content changes. Below are the steps for your custom assets, from the build plugin to the minifier plugin for apps that load assets through annotations.

What's new in version 26.01?

· 8 minuuttia
webforJ
Do it all in Java. The full-stack Java framework for business web apps.

cover image

webforJ 26.01 is live! The headline is a new frontend bundler: a Bun-powered build step wired into the Maven and Gradle build you already run, letting a Java view pull in npm packages and web components without a separate frontend project or a Node toolchain. Alongside it, this release reworks live reload, adds a new Upload component, brings browser APIs for geolocation, page visibility, and app icon badges, and gives AppNav pinning and search. See the highlights below, and as always, the GitHub release overview has the complete picture.

Stream ChatGPT responses into a Java web UI with markdown

· 6 minuuttia
Eric Handtke
Software Developer

cover image

To stream ChatGPT responses in a Java web app, send each chunk from the model into a webforJ MarkdownViewer. The component renders Markdown as it arrives, keeps the newest text in view, and gives you stop() and whenRenderComplete() for the moments when the user cancels or the answer ends. The model call stays in a plain service, and the view only appends text.

The webforJ learning curve: hiring and onboarding

· 8 minuuttia
webforJ
Do it all in Java. The full-stack Java framework for business web apps.

cover image

You are weighing a Java web UI framework, and the question right after "does it do what we need" is "who will build with it?" A framework that few people list on a CV can look like a hiring risk, and a smaller community can look like a support risk.

Hiring for webforJ, the full-stack Java framework, means hiring Java developers. The webforJ learning curve is the curve of Java itself: the UI is written in Java classes, wired with listeners, built with Maven, debugged in a standard debugger, and tested with JUnit. A Swing or Spring developer already knows most of what a first webforJ view needs, so you do not need candidates with webforJ on their CV and no front-end specialist has to join the team to ship a screen.

A Java reactive UI framework without reactive streams

· 8 minuuttia
Matthew Hawkins
Software Developer

cover image

You change a value somewhere in your Java code, and you want the screen to follow without hand-writing refresh calls for every label and every table. That is what most developers mean when they search for a Java reactive UI framework, and it rarely has anything to do with reactive streams.

webforJ, the full-stack Java framework, is a Java reactive UI framework in the sense that matters for screens: the UI reacts to events, to bound data and to repository commits, and background work can push changes to the page. It does this with event listeners and data binding, not with a streams library, and this post shows how those pieces fit together.

Java web terminal: embed a terminal in webforJ

· 6 minuuttia
Matthew Hawkins
Software Developer

cover image

Some tools are easier to use with a prompt than with forms: an admin console, a log viewer, a way to run a quick command against a live server. Building one in the browser usually means a JavaScript terminal library and the code to wire it to your backend.

A Java web terminal in webforJ skips that wiring. The Terminal component is a full console you place in a view like any other component, and every keystroke reaches your Java code as an event.

Swing to JavaScript communication with webforJ and Webswing

· 9 minuuttia
Eric Handtke
Software Developer

cover image

Webswing gets a Swing app into a browser tab in an afternoon. Then someone asks for the obvious next thing: when the user picks a customer in the Swing window, the web page around it should show that customer's orders. And the web page can't see anything that happens inside the Swing window.

That is the real problem with Swing to JavaScript communication. The fix is a message channel: the Swing app announces what happened as a named action, the web side reacts, and it can send actions back. In webforJ that channel is one component, and both ends are plain Java.

Replace React with Java: moving a front end to webforJ

· 9 minuuttia
webforJ
Do it all in Java. The full-stack Java framework for business web apps.

cover image

Many Java teams run a React or Angular front end that only exists to show what their Spring backend already knows. Every feature gets built twice, once on each side of a REST layer, by two sets of people with two toolchains.

If you want to replace React with Java, or move from Angular to a Java UI, you can do it one screen at a time. Each screen becomes a webforJ view that calls your Spring services directly, and the front end and its REST layer fold into one Spring Boot project.

Spring Boot login page: a Java UI with webforJ Login

· 7 minuuttia
Eric Handtke
Software Developer

cover image

Almost every business app starts with the same screen: a username, a password, and a Sign in button. Building it by hand means a dialog, two required fields, an error message and a button that shouldn't be clicked twice, before you've checked a single credential.

A Spring Boot login page with a Java UI takes one component in webforJ. Login brings the dialog, the fields, the checks and the error message, so your code only has to decide whether the credentials are right.

Modernize an ERP UI in Java without a big-bang rewrite

· 9 minuuttia
webforJ
Do it all in Java. The full-stack Java framework for business web apps.

cover image

Your ERP works. The accounting rules, the pricing logic and the warehouse flows took years to get right, and the Swing screens in front of them are what everyone wants to replace. To modernize an enterprise resource planning (ERP) UI in Java, keep the domain code, and move the screens in steps. webforJ, the full-stack Java framework, embeds the running desktop app in a web page through Webswing, so users can reach the app in a browser early, and your team then replaces each screen with a Java view.

Toast notification in Java: show messages with webforJ

· 5 minuuttia
Eric Handtke
Software Developer

cover image

A toast notification is a short message that appears on screen and then disappears by itself. In webforJ, you show one from any Java click handler with a single call: Toast.show("Changes saved", Theme.SUCCESS). The Toast component has been part of webforJ since version 24.10. It handles timing, colors, and screen placement, so you don't write JavaScript for it.

This guide shows you how to add toasts to a view, control how long they stay, and keep important alerts on screen until the user dismisses them.

Struts to Spring Boot migration with webforJ

· 8 minuuttia
webforJ
Do it all in Java. The full-stack Java framework for business web apps.

cover image

Your team maintains an app built around action classes, JSP views, and a mapping file. It works, the business rules inside it are valuable, and every new screen still means touching three or four files in different places. If you are planning a Struts to Spring Boot migration, or weighing an Apache Struts alternative, the short answer is webforJ, the full-stack Java framework, with your Spring Boot services plugged in: each action and JSP pair becomes one Java view with a route, the markup and tag libraries become Java components, form beans become validated data binding, and your services carry over unchanged.