<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>webforJ Blog</title>
        <link>https://docs.webforj.com/blog</link>
        <description>webforJ Blog</description>
        <lastBuildDate>Mon, 16 Nov 2026 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <item>
            <title><![CDATA[Rewrite or migrate a legacy Java application: how to decide]]></title>
            <link>https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app</link>
            <guid>https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app</guid>
            <pubDate>Mon, 16 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Should you rewrite or migrate a legacy Java application? Why rewrites fail, when one is still right, and the incremental path that keeps your app running.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-16-rewrite-or-migrate-legacy-java-app/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>Somewhere in your company there is a Java app that runs the business. It works, the rules inside it took years to get right, and the people who wrote most of it have moved on. Now it needs to reach the browser, and the meeting keeps circling back to one question. Do we start over, or do we move what we have?</p>
<p>This page is for the architect who has to recommend an answer and the budget holder who has to sign it. Whether to rewrite or migrate a legacy Java application is mostly a question of risk, and a rewrite carries the most of it. Our case is simple: keep your Java app running, and move it to the web one screen at a time, with your own Java team.</p>
<div class="cta_UErl" role="complementary" aria-label="Moving a desktop Java app to the web?"><div class="copy_XH8h"><p class="title_HfaR">Moving a desktop Java app to the web?</p><p class="text_x4Wj">Send us a screenshot of one screen and we'll reply with how it moves to webforJ.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="mailto:sales@basis.cloud?subject=My%20app%20screen%3A%20how%20would%20it%20move%20to%20webforJ%3F&amp;body=Hi%20webforJ%20team%2C%0A%0AAttached%20is%20a%20screenshot%20of%20one%20screen%20from%20our%20app.%20It%20is%20built%20with%3A%20(Swing%2C%20JavaFX%2C%20other)%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Send a screenshot</a><a class="secondary_GDTR" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-rewrites-fail">Why rewrites fail so often<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#why-rewrites-fail" class="hash-link" aria-label="Direct link to Why rewrites fail so often" title="Direct link to Why rewrites fail so often" translate="no">​</a></h2>
<p>If your last rewrite failed, you are in good company. Large rewrites fail often, and they tend to fail the same way.</p>
<p>The plan starts with a clean slate and a date. Then the team finds out how much the old app really does. Every screen hides rules nobody wrote down, so the estimate grows while the old system keeps getting changes that the new one has to catch up with. Years in, the budget has been overstepped more than once, a part of the features is finished, and users still work in the old app every day. At that point the business either pays again or throws the project away.</p>
<p>None of this means your team is weak. It means a rewrite stacks several hard problems into one long project with no value delivered until the end.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-a-rewrite-asks">What a rewrite really asks of you<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#what-a-rewrite-asks" class="hash-link" aria-label="Direct link to What a rewrite really asks of you" title="Direct link to What a rewrite really asks of you" translate="no">​</a></h2>
<p>A rewrite looks like a coding project. It is mostly a discovery project with coding attached.</p>
<ul>
<li class=""><strong>Rediscover every rule.</strong> Validation quirks, rounding, the special case for one customer: the old code holds them and the documentation usually does not. For each odd behavior the rewrite team has to work out whether it is a bug, a feature, or a habit of the original author.</li>
<li class=""><strong>Freeze or fork the product.</strong> Either new features stop while the rewrite catches up, or every change is built twice, once in the old system and once in the new one. Sales and customers notice both.</li>
<li class=""><strong>Depend on people who left.</strong> The knowledge you need to rewrite safely is the knowledge that walked out the door, and a rewrite that runs for years loses more of it along the way.</li>
<li class=""><strong>Bet the budget on the last month.</strong> Users see nothing until cutover. If funding stops halfway, the company owns a half-finished system and the old one it was meant to replace.</li>
</ul>
<p>The risk comes down to one thing. You have to understand the system before you can rewrite it, or you end up with a different mess.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="rewrite-or-refactor">Rewrite or refactor: the real question<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#rewrite-or-refactor" class="hash-link" aria-label="Direct link to Rewrite or refactor: the real question" title="Direct link to Rewrite or refactor: the real question" translate="no">​</a></h2>
<p>"Rewrite or refactor" sounds like a choice about code. For a business app it is really a choice about which layer is broken.</p>
<p>In most aging Java apps the business logic is not the problem. Pricing rules, validation, integrations and the database schema encode years of decisions and are usually correct. What ages badly is how people reach that logic: a desktop client that needs installing, a page technology fewer developers want to learn, a UI that cannot run in a browser.</p>
<p>When the logic is sound and the screens are the problem, rewriting everything spends most of the budget on the part that already works. Moving the screens, and keeping the logic behind them, puts the money where users feel the change. Our <a class="" href="https://docs.webforj.com/blog/legacy-java-modernization-strategy">legacy Java modernization strategy</a> covers how to triage a whole portfolio on that basis.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="when-to-rewrite">When a rewrite is the right call<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#when-to-rewrite" class="hash-link" aria-label="Direct link to When a rewrite is the right call" title="Direct link to When a rewrite is the right call" translate="no">​</a></h2>
<p>A rewrite is not always wrong, and pretending otherwise would not help you decide. Starting over can make sense when:</p>
<ul>
<li class="">The business logic itself is wrong or no longer matches how the business works, so there is little worth keeping.</li>
<li class="">The app is small enough that a team can rebuild it in one release cycle while the old one keeps running.</li>
<li class="">The domain changed so much that the new system is a different product, not a new version of the old one.</li>
<li class="">Nobody can run, build or deploy the existing code anymore, so nothing can be kept in place while you move.</li>
</ul>
<p>Even in those cases a rewrite needs one thing first: a clear picture of what the app has to do. If you cannot write that picture down, a rewrite inherits the same gaps as the original.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="five-questions">Five questions to settle first<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#five-questions" class="hash-link" aria-label="Direct link to Five questions to settle first" title="Direct link to Five questions to settle first" translate="no">​</a></h2>
<p>Put these to the team and the business owner before anyone estimates anything.</p>
<ol>
<li class=""><strong>Is the business logic correct?</strong> If yes, the case for a full rewrite is weak from the start.</li>
<li class=""><strong>Can the business stop shipping features?</strong> If not, any plan that needs a long freeze is a plan on paper.</li>
<li class=""><strong>Who still understands the app?</strong> If the answer is one or two people, a rewrite depends on them for its whole length. An incremental move uses their time one screen at a time.</li>
<li class=""><strong>What does your team know?</strong> A Java team asked to rebuild in a new language and a new stack is learning while it rewrites. Two kinds of risk at once.</li>
<li class=""><strong>Is a deadline forcing the move?</strong> <a href="https://struts.apache.org/struts1eol-announcement.html" target="_blank" rel="noopener noreferrer" class="">Struts 1 reached end of life</a> with its last release in 2008, while current Struts 6 and 7 are maintained. Java Web Start left the JDK with Java 11, and JEP 504 <a href="https://openjdk.org/jeps/504" target="_blank" rel="noopener noreferrer" class="">removes the Applet API</a> after JDK 25. A deadline forces you to move. It does not force you to rewrite.</li>
</ol>
<p>If most answers point to "the logic is fine, the business cannot stop, and the team knows Java", you already have your answer.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="rewrite-vs-migrate">Rewrite vs migrate, side by side<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#rewrite-vs-migrate" class="hash-link" aria-label="Direct link to Rewrite vs migrate, side by side" title="Direct link to Rewrite vs migrate, side by side" translate="no">​</a></h2>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th></th><th>Full rewrite</th><th>Incremental migration</th></tr></thead><tbody><tr><td><strong>First thing users see</strong></td><td>The new system, at cutover</td><td>A working app in the browser, then new screens one at a time</td></tr><tr><td><strong>If funding stops halfway</strong></td><td>A half-built system next to the old one</td><td>Every screen already moved stays in use</td></tr><tr><td><strong>Business rules</strong></td><td>Rediscovered and reimplemented</td><td>Kept and called from the new screens</td></tr><tr><td><strong>Feature work during the move</strong></td><td>Frozen, or built twice</td><td>Continues, in the old app or in the new screens</td></tr><tr><td><strong>Who does the work</strong></td><td>Often a new team or a new stack</td><td>Your existing Java team</td></tr><tr><td><strong>Where the risk sits</strong></td><td>One large bet at the end</td><td>Small steps you can review and stop</td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<p>Incremental is not free. You run old and new side by side for a while, and each screen still needs building and testing. But each step pays for itself, and you can stop after any of them. How to sequence the cutover itself is a separate decision from whether to rewrite at all.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="incremental-path">The incremental path, in Java<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#incremental-path" class="hash-link" aria-label="Direct link to The incremental path, in Java" title="Direct link to The incremental path, in Java" translate="no">​</a></h2>
<p>webforJ is a full-stack Java framework for business web apps. It gives the incremental path a concrete shape.</p>
<p><strong>For Swing, JavaFX and SWT desktop apps,</strong> Webswing runs Java desktop apps in a web browser <a class="" href="https://docs.webforj.com/docs/integrations/webswing/overview">without any modifications to the original source code</a>. webforJ embeds that running app in a webforJ view with the <code>WebswingConnector</code>, available since webforJ 25.10. Users open a URL instead of installing a client, and the old app keeps working the way they know it. Webswing and webforJ are partners: Webswing runs the app today, and webforJ carries it forward.</p>
<p>New screens are built in webforJ next to the embedded app, in the same browser tab. The two sides can exchange data both ways. That part needs a small addition on the Swing side using the Webswing Java API, which the <a class="" href="https://docs.webforj.com/docs/integrations/webswing/communication">communication docs</a> cover. Screen by screen, the webforJ side grows and the Swing side shrinks until it can be retired.</p>
<p><strong>For Struts, JSF and JSP web apps,</strong> there is no bridge to run, because these apps already live in a browser. Here, avoiding a full rewrite means rebuilding the UI in Java, page by page, against the services you already have. You rewrite the screens, not the system.</p>
<p>In both cases the new screens are written the way a Java developer already thinks. Components are Java objects, events are listeners, and layouts are composed in Java. The business logic stays where it is, and if it already runs on Spring, the beans stay too. Existing Spring Data repositories, for example, <a class="" href="https://docs.webforj.com/docs/integrations/spring/spring-data-jpa">work with webforJ components without modification</a>.</p>
<p>If your estate is Swing and you want the paths compared in detail, including a JavaScript rewrite, the <a class="" href="https://docs.webforj.com/blog/migrate-swing-app-to-web">Java Swing to web migration guide</a> lays them out with a decision table.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="budget-case">Making the case to the budget holder<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#budget-case" class="hash-link" aria-label="Direct link to Making the case to the budget holder" title="Direct link to Making the case to the budget holder" translate="no">​</a></h2>
<p>A rewrite asks for one large approval with nothing to show until the end. The incremental path turns that into a series of small approvals, each with something users can open.</p>
<ul>
<li class=""><strong>Step one buys reach.</strong> The existing app becomes available in the browser. For desktop apps that means less installing and patching on every machine.</li>
<li class=""><strong>Each screen buys a visible improvement.</strong> You pick the screens that matter most, and each one ships when it is ready.</li>
<li class=""><strong>Stopping is allowed.</strong> If priorities change, what has moved stays moved. Nothing is written off.</li>
</ul>
<p>Prodin, an ERP vendor, kept its Java business logic when it moved to the web with webforJ, some of it written over two decades earlier. By reusing its existing Java code, <a href="https://webforj.com/wp-content/uploads/2024/10/BASIS_SuccessStory_Prodin.pdf" target="_blank" rel="noopener noreferrer" class="">Prodin avoided the expense of a complete rewrite</a>, and its first web-based modules shipped to customers within four months.</p>
<p>AI can do much of the porting, and each step stays easy to review. The <a class="" href="https://docs.webforj.com/docs/ai-tooling">webforJ AI plugin</a> connects your assistant to the webforJ documentation and API through the MCP server and Agent Skills, so it looks up methods instead of guessing them.</p>
<p>Ask the agent for a <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a> test with every screen it ports. The TestBed runs the view in a plain JUnit test, with no browser and no server, so the agent gets a pass or a fail on each change before a developer looks at it. That is the <a class="" href="https://docs.webforj.com/blog/ai-verification-loop-java">AI verification loop</a>: write against the real API, then prove the behavior with a test. A developer still reviews every change. These tools work on the new webforJ screens, not on the Swing screens running inside Webswing.</p>
<p>Behind the framework is BASIS International, which has built tools for business software since 1985. For a budget holder, that means a vendor with a long record in exactly this kind of app.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-should-we-rewrite">Should we rewrite our Java app?<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#faq-should-we-rewrite" class="hash-link" aria-label="Direct link to Should we rewrite our Java app?" title="Direct link to Should we rewrite our Java app?" translate="no">​</a></h3>
<p>Usually not, if the business logic is correct and the business cannot stop shipping features. In that case, keep the app running and move it to the web one screen at a time. A rewrite makes more sense when the logic itself is wrong or the app is small enough to rebuild in one release cycle.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-rewrite-or-refactor">Is it better to rewrite or refactor a legacy app?<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#faq-rewrite-or-refactor" class="hash-link" aria-label="Direct link to Is it better to rewrite or refactor a legacy app?" title="Direct link to Is it better to rewrite or refactor a legacy app?" translate="no">​</a></h3>
<p>For most business applications, keeping and refactoring the logic while replacing the screens costs less and carries less risk than starting over. A rewrite has to rediscover every rule the old code already holds, often without the people who wrote it.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-rewrite-vs-migrate">What is the difference between a rewrite and a migration?<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#faq-rewrite-vs-migrate" class="hash-link" aria-label="Direct link to What is the difference between a rewrite and a migration?" title="Direct link to What is the difference between a rewrite and a migration?" translate="no">​</a></h3>
<p>A rewrite replaces the whole system and delivers value at cutover. An incremental migration keeps the existing app working and replaces it in steps, so users get improvements along the way and the business rules carry over.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-keep-running">Can the old app keep running while we migrate?<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#faq-keep-running" class="hash-link" aria-label="Direct link to Can the old app keep running while we migrate?" title="Direct link to Can the old app keep running while we migrate?" translate="no">​</a></h3>
<p>Yes. For Swing, JavaFX and SWT apps, Webswing runs the existing app in the browser, and webforJ embeds it next to the new screens in the same tab. Struts, JSF and JSP apps keep serving their old pages while new webforJ views replace them one at a time.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="plan-first-move">Plan your first move with us<a href="https://docs.webforj.com/blog/rewrite-or-migrate-legacy-java-app#plan-first-move" class="hash-link" aria-label="Direct link to Plan your first move with us" title="Direct link to Plan your first move with us" translate="no">​</a></h2>
<p>See how the screen-by-screen path works for your app and talk to us about it on the <a class="" href="https://docs.webforj.com/modernization">webforJ modernization page</a>.</p><div></div>]]></content:encoded>
            <category>Insights</category>
            <category>Modernization</category>
        </item>
        <item>
            <title><![CDATA[Parallel run migration: prove each new Java screen with a test]]></title>
            <link>https://docs.webforj.com/blog/test-migrated-java-screen</link>
            <guid>https://docs.webforj.com/blog/test-migrated-java-screen</guid>
            <pubDate>Sat, 14 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[In a parallel run migration the old and new versions run side by side. Keep the old Java app running, ship new webforJ screens, and pin each with a TestBed test.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-14-test-migrated-java-screen/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>You have moved the first screen of an old Java app to the web, and it looks right. The next question is harder. Does it still behave the way the old screen did, and will it still behave that way after the next ten screens land? Nobody wants a user to be the one who finds out.</p>
<p>In a parallel run migration the old and the new version run side by side, and the old one is the reference you compare against. For a Java desktop app, Webswing keeps the existing app running in the browser while webforJ builds the replacement screens next to it in the same tab, so the old behavior is still there to check each new screen against. This guide gives every new webforJ screen a TestBed test, a plain JUnit test with no browser, that pins the behavior your users rely on. Each screen passes its tests before the next one starts.</p>
<div class="cta_UErl" role="complementary" aria-label="Moving a desktop Java app to the web?"><div class="copy_XH8h"><p class="title_HfaR">Moving a desktop Java app to the web?</p><p class="text_x4Wj">Send us a screenshot of one screen and we'll reply with how it moves to webforJ.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="mailto:sales@basis.cloud?subject=My%20app%20screen%3A%20how%20would%20it%20move%20to%20webforJ%3F&amp;body=Hi%20webforJ%20team%2C%0A%0AAttached%20is%20a%20screenshot%20of%20one%20screen%20from%20our%20app.%20It%20is%20built%20with%3A%20(Swing%2C%20JavaFX%2C%20other)%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Send a screenshot</a><a class="secondary_GDTR" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-a-test">Why a ported screen needs a test<a href="https://docs.webforj.com/blog/test-migrated-java-screen#why-a-test" class="hash-link" aria-label="Direct link to Why a ported screen needs a test" title="Direct link to Why a ported screen needs a test" translate="no">​</a></h2>
<p>During a parallel run the old screen is still there to compare against, so the first check is easy. Open both, try the same steps, and see whether they match. The trouble starts later. Screen six changes a shared service or a common layout, and screen one breaks without anyone opening it again.</p>
<p>A test turns what you checked by hand into something the build checks on every change. The webforJ <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a>, available since 26.03, runs a view inside a plain JUnit test. No browser is opened and no server is started. The test finds components the way a user does, acts on them, and checks what the page shows, and it runs in the same <code>mvn test</code> as your unit tests.</p>
<p>Be clear about what it tests. The TestBed tests the new webforJ screens. The Swing screens still running inside <a class="" href="https://docs.webforj.com/docs/integrations/webswing/overview">Webswing</a> are rendered on the server and streamed to the browser as an HTML5 canvas, so a TestBed test never reaches them. The old screen is your reference. The new screen is what the test pins.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-1-list-behavior">Step 1: write down what users rely on<a href="https://docs.webforj.com/blog/test-migrated-java-screen#step-1-list-behavior" class="hash-link" aria-label="Direct link to Step 1: write down what users rely on" title="Direct link to Step 1: write down what users rely on" translate="no">​</a></h2>
<p>Before you port a screen, open the old one and list what a user reads and does on it, as plain sentences. Take a small subscribe form as the example:</p>
<ol>
<li class="">The address field carries the label <code>Email</code>.</li>
<li class=""><strong>Subscribe</strong> stays disabled until the field holds an address.</li>
<li class="">After a click, the screen confirms the address it subscribed.</li>
</ol>
<p>Each sentence becomes one test. Keep the sentences about what the user reads and does, not about how the old code was built. A TestBed test works through what the page shows, so it keeps passing when the view is built differently and fails when the user would see something else. That's exactly the property a port needs.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-2-dependency">Step 2: add the TestBed dependency<a href="https://docs.webforj.com/blog/test-migrated-java-screen#step-2-dependency" class="hash-link" aria-label="Direct link to Step 2: add the TestBed dependency" title="Direct link to Step 2: add the TestBed dependency" translate="no">​</a></h2>
<p>The TestBed is a separate module. Add it with test scope:</p>
<div class="language-xml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">pom.xml</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-xml codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token tag" style="color:var(--dwc-code-number)">dependency</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token tag" style="color:var(--dwc-code-number)">groupId</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain">com.webforj</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;/</span><span class="token tag" style="color:var(--dwc-code-number)">groupId</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token tag" style="color:var(--dwc-code-number)">artifactId</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain">webforj-testbed-junit</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;/</span><span class="token tag" style="color:var(--dwc-code-number)">artifactId</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token tag" style="color:var(--dwc-code-number)">scope</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain">test</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;/</span><span class="token tag" style="color:var(--dwc-code-number)">scope</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;/</span><span class="token tag" style="color:var(--dwc-code-number)">dependency</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><br></div></code></pre></div></div>
<p>The version comes from the webforJ Bill of Materials, so the dependency declares none. Spring Boot apps use the <code>webforj-spring-testbed</code> module instead, covered in <a class="" href="https://docs.webforj.com/docs/integrations/spring/testing">Spring testing</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-3-build-screen">Step 3: build the new screen in webforJ<a href="https://docs.webforj.com/blog/test-migrated-java-screen#step-3-build-screen" class="hash-link" aria-label="Direct link to Step 3: build the new screen in webforJ" title="Direct link to Step 3: build the new screen in webforJ" translate="no">​</a></h2>
<p>The webforJ version of the form is one Java class. The button starts disabled, and a listener on the field turns it on once an address is typed:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">NewsletterForm.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">NewsletterForm</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">extends</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Composite</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token generics class-name" style="color:var(--dwc-code-class)">Div</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">NewsletterForm</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token plain"> email </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Email"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token plain"> status </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token plain"> subscribe </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">        </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">            </span><span class="token string" style="color:var(--dwc-code-string)">"Subscribe"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> e </span><span class="token operator" style="color:var(--dwc-code-operator)">-&gt;</span><span class="token plain"> status</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Subscribed "</span><span class="token plain"> </span><span class="token operator" style="color:var(--dwc-code-operator)">+</span><span class="token plain"> email</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getValue</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    subscribe</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setEnabled</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token boolean" style="color:var(--dwc-code-number)">false</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    email</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">onModify</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">e </span><span class="token operator" style="color:var(--dwc-code-operator)">-&gt;</span><span class="token plain"> subscribe</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setEnabled</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token operator" style="color:var(--dwc-code-operator)">!</span><span class="token plain">email</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getValue</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">isBlank</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token function" style="color:var(--dwc-code-function)">getBoundComponent</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">email</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> subscribe</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> status</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-4-pin-behavior">Step 4: pin each behavior in a test<a href="https://docs.webforj.com/blog/test-migrated-java-screen#step-4-pin-behavior" class="hash-link" aria-label="Direct link to Step 4: pin each behavior in a test" title="Direct link to Step 4: pin each behavior in a test" translate="no">​</a></h2>
<p>Sentences 1 and 3 from the list fit in one test. It finds the field by its label and the button by its text, types an address, clicks, and checks the confirmation. The test class carries <code>@WebforjTest</code>, which gives each test method its own <code>WebforjTestbed</code>:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">NewsletterFormTest.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Test</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">shouldSubscribeTheEmailTheUserTyped</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">WebforjTestbed</span><span class="token plain"> context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">NewsletterForm</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">var</span><span class="token plain"> email </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">byLabel</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Email"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">var</span><span class="token plain"> subscribe </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">byText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Subscribe"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token class-name" style="color:var(--dwc-code-class)">UserInteraction</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">type</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">email</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"ada@example.com"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token class-name" style="color:var(--dwc-code-class)">UserInteraction</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">click</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">subscribe</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token function" style="color:var(--dwc-code-function)">assertTrue</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">          </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">byText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Subscribed ada@example.com"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">          </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">isPresent</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>If someone changes that label to <code>E-mail address</code> during the port, <code>byLabel("Email")</code> finds nothing and the test fails. Users who learned the old screen notice that kind of change, so the test should too.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-5-what-users-cant-do">Step 5: pin what a user can't do<a href="https://docs.webforj.com/blog/test-migrated-java-screen#step-5-what-users-cant-do" class="hash-link" aria-label="Direct link to Step 5: pin what a user can't do" title="Direct link to Step 5: pin what a user can't do" translate="no">​</a></h2>
<p>Sentence 2 is a rule, and rules are where ported screens drift. <code>UserInteraction</code> makes only the gestures a user could make, so clicking a disabled button throws an <code>InteractionRejectedException</code> and the listener never runs:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">NewsletterFormTest.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Test</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">shouldRejectTheClickWhileNoEmailIsTyped</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">WebforjTestbed</span><span class="token plain"> context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">NewsletterForm</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">var</span><span class="token plain"> subscribe </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">byText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Subscribe"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token function" style="color:var(--dwc-code-function)">assertThrows</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token class-name" style="color:var(--dwc-code-class)">InteractionRejectedException</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token operator" style="color:var(--dwc-code-operator)">-&gt;</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">UserInteraction</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">click</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">subscribe</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token function" style="color:var(--dwc-code-function)">assertFalse</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">          </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">byTextContaining</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Subscribed"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">          </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">isPresent</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>If a later change drops the <code>setEnabled(false)</code> line, the click goes through, nothing is thrown, and this test goes red.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-6-snapshot">Step 6: pin a whole screen with a snapshot<a href="https://docs.webforj.com/blog/test-migrated-java-screen#step-6-snapshot" class="hash-link" aria-label="Direct link to Step 6: pin a whole screen with a snapshot" title="Direct link to Step 6: pin a whole screen with a snapshot" translate="no">​</a></h2>
<p>Some screens are mostly read: an order summary, a detail view, a confirmation page. Checking each label one by one takes a long test. A snapshot writes down everything a user would see in the view, one line per component, and stores that description next to the test. Here <code>OrderSummary</code> is a view with an order number, a note field, a hidden discount line, a <strong>Pay</strong> button and a disabled <strong>Cancel</strong> button. Its full source is on the <a class="" href="https://docs.webforj.com/docs/testing/testbed/snapshots">snapshots page</a>:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">OrderSummaryTest.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Test</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">shouldMatchTheSnapshot</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">WebforjTestbed</span><span class="token plain"> context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">var</span><span class="token plain"> summary </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">OrderSummary</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">summary</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token function" style="color:var(--dwc-code-function)">verifyThat</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">summary</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">matchesSnapshot</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>The first run writes the file and passes:</p>
<div class="language-snapshot codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">OrderSummaryTest.shouldMatchTheSnapshot.yml</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-snapshot codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token comment" style="color:var(--dwc-code-comment);font-style:italic"># webforJ testbed snapshot v1</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">-</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">OrderSummary</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute property" style="color:var(--dwc-code-number)">composite</span><span class="token attribute operator" style="color:var(--dwc-code-operator)">=</span><span class="token attribute variable" style="color:var(--dwc-code-variable)">Div</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute property" style="color:var(--dwc-code-number)">node</span><span class="token attribute operator" style="color:var(--dwc-code-operator)">=</span><span class="token attribute variable" style="color:var(--dwc-code-variable)">div</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">-</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"Order 1042"</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute property" style="color:var(--dwc-code-number)">composite</span><span class="token attribute operator" style="color:var(--dwc-code-operator)">=</span><span class="token attribute variable" style="color:var(--dwc-code-variable)">Element</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute property" style="color:var(--dwc-code-number)">node</span><span class="token attribute operator" style="color:var(--dwc-code-operator)">=</span><span class="token attribute variable" style="color:var(--dwc-code-variable)">p</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">-</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute property" style="color:var(--dwc-code-number)">label</span><span class="token attribute operator" style="color:var(--dwc-code-operator)">=</span><span class="token attribute variable" style="color:var(--dwc-code-variable)">Note</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><span class="token plain"> [placeholder=</span><span class="token string" style="color:var(--dwc-code-string)">"Delivery instructions"</span><span class="token plain">]</span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">-</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"Discount applied"</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute property" style="color:var(--dwc-code-number)">composite</span><span class="token attribute operator" style="color:var(--dwc-code-operator)">=</span><span class="token attribute variable" style="color:var(--dwc-code-variable)">Element</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute property" style="color:var(--dwc-code-number)">node</span><span class="token attribute operator" style="color:var(--dwc-code-operator)">=</span><span class="token attribute variable" style="color:var(--dwc-code-variable)">p</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute keyword" style="color:var(--dwc-code-keyword)">hidden</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">-</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"Pay"</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute property" style="color:var(--dwc-code-number)">theme</span><span class="token attribute operator" style="color:var(--dwc-code-operator)">=</span><span class="token attribute variable" style="color:var(--dwc-code-variable)">primary</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">-</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Icon</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute property" style="color:var(--dwc-code-number)">slot</span><span class="token attribute operator" style="color:var(--dwc-code-operator)">=</span><span class="token attribute variable" style="color:var(--dwc-code-variable)">prefix</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute property" style="color:var(--dwc-code-number)">name</span><span class="token attribute operator" style="color:var(--dwc-code-operator)">=</span><span class="token attribute variable" style="color:var(--dwc-code-variable)">credit-card</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute property" style="color:var(--dwc-code-number)">composite</span><span class="token attribute operator" style="color:var(--dwc-code-operator)">=</span><span class="token attribute variable" style="color:var(--dwc-code-variable)">Element</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute property" style="color:var(--dwc-code-number)">node</span><span class="token attribute operator" style="color:var(--dwc-code-operator)">=</span><span class="token attribute variable" style="color:var(--dwc-code-variable)">dwc-icon</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">-</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"Cancel"</span><span class="token plain"> </span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">[</span><span class="token attribute keyword" style="color:var(--dwc-code-keyword)">disabled</span><span class="token attribute punctuation" style="color:var(--dwc-code-punctuation)">]</span><br></div></code></pre></div></div>
<p>Read that file next to the old screen. If it matches what users saw before, commit it. Every later run describes the view again and compares. When the <strong>Pay</strong> button turns into <strong>Pay now</strong>, <code>mvn test</code> fails with a plain diff:</p>
<div class="language-diff codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">Terminal</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-diff codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token deleted-sign deleted prefix deleted" style="color:var(--dwc-code-string)">-</span><span class="token deleted-sign deleted line" style="color:var(--dwc-code-string)">  - Button "Pay" [theme=primary]:</span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token deleted-sign deleted line" style="color:var(--dwc-code-string)"></span><span class="token inserted-sign inserted prefix inserted" style="color:var(--dwc-code-number)">+</span><span class="token inserted-sign inserted line" style="color:var(--dwc-code-number)">  - Button "Pay now" [theme=primary]:</span><br></div></code></pre></div></div>
<p>When a change is intended, run <code>mvn test -Dwebforj.testbed.updateSnapshots=true</code> once and review the changed files like code. On a CI server the TestBed never writes snapshot files, so a missing snapshot fails the build instead of being written, and an update run fails too. An outdated snapshot fails on every machine until you review and update it. The <a class="" href="https://docs.webforj.com/docs/testing/testbed/snapshots">snapshots page</a> covers the format and the options.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-7-go-green">Step 7: go green before the next screen<a href="https://docs.webforj.com/blog/test-migrated-java-screen#step-7-go-green" class="hash-link" aria-label="Direct link to Step 7: go green before the next screen" title="Direct link to Step 7: go green before the next screen" translate="no">​</a></h2>
<p>TestBed tests are plain JUnit tests. <code>mvn test</code> runs them with the rest of the suite, and your CI runs them on every push. Make that the gate of the migration. A screen counts as moved when its tests pass, and the next screen starts after that.</p>
<p>This keeps the <a class="" href="https://docs.webforj.com/blog/strangler-fig-pattern-java-swing">strangler fig approach</a> honest. Users switch to the new screen while the old one stays available in Webswing, and every screen you already moved stays pinned while you work on the next. If an AI assistant writes the port, the same tests give it a pass or a fail before you review, which is the loop in <a class="" href="https://docs.webforj.com/blog/ai-verification-loop-java">the AI verification loop for Java</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="limits">What a TestBed test doesn't cover<a href="https://docs.webforj.com/blog/test-migrated-java-screen#limits" class="hash-link" aria-label="Direct link to What a TestBed test doesn't cover" title="Direct link to What a TestBed test doesn't cover" translate="no">​</a></h2>
<p>A TestBed test checks what your views do when a user works with them. It leaves out two things:</p>
<ul>
<li class=""><strong>The Swing screens.</strong> They run inside Webswing and reach the browser as a canvas. The TestBed finds webforJ components only.</li>
<li class=""><strong>What only a browser shows.</strong> Styling, layout and client behavior belong in a few browser tests. <a class="" href="https://docs.webforj.com/blog/java-web-app-testing-strategy">Java web app testing strategy</a> shows how to split the layers so the browser suite stays small.</li>
</ul>
<p>For a full tour of locating, acting and asserting, read <a class="" href="https://docs.webforj.com/blog/java-ui-testing-without-browser">Java UI testing without a browser</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="checklist">Checklist for every ported screen<a href="https://docs.webforj.com/blog/test-migrated-java-screen#checklist" class="hash-link" aria-label="Direct link to Checklist for every ported screen" title="Direct link to Checklist for every ported screen" translate="no">​</a></h2>
<ul class="contains-task-list containsTaskList_mC6p">
<li class="task-list-item"><input type="checkbox" disabled=""> <!-- -->The old screen's behavior is written down as plain sentences.</li>
<li class="task-list-item"><input type="checkbox" disabled=""> <!-- -->Each sentence has a TestBed test on the new webforJ screen.</li>
<li class="task-list-item"><input type="checkbox" disabled=""> <!-- -->Rules, such as a disabled button, have a test that tries the forbidden gesture.</li>
<li class="task-list-item"><input type="checkbox" disabled=""> <!-- -->Mostly read screens have a snapshot that was checked against the old screen.</li>
<li class="task-list-item"><input type="checkbox" disabled=""> <!-- -->Snapshot files are committed next to the tests.</li>
<li class="task-list-item"><input type="checkbox" disabled=""> <code>mvn test</code> passes locally and in CI.</li>
<li class="task-list-item"><input type="checkbox" disabled=""> <!-- -->Only then does the next screen start.</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="plan-your-migration">Plan your migration with us<a href="https://docs.webforj.com/blog/test-migrated-java-screen#plan-your-migration" class="hash-link" aria-label="Direct link to Plan your migration with us" title="Direct link to Plan your migration with us" translate="no">​</a></h2>
<p>When you are ready to pick the first screens and plan the parallel run, <a class="" href="https://docs.webforj.com/modernization">see how the path works and talk to us</a>.</p><div></div>]]></content:encoded>
            <category>Tutorial</category>
            <category>Modernization</category>
            <category>Webswing</category>
        </item>
        <item>
            <title><![CDATA[Big bang migration vs phased: how to cut over a Java app]]></title>
            <link>https://docs.webforj.com/blog/big-bang-vs-phased-migration-java</link>
            <guid>https://docs.webforj.com/blog/big-bang-vs-phased-migration-java</guid>
            <pubDate>Fri, 13 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Big bang migration vs phased for a Java business app: cut over one screen at a time with Webswing and webforJ, with a rollback plan at every step.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-13-big-bang-vs-phased-migration-java/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>The decision to leave the desktop is made. The app runs orders, claims or payroll every day, the budget is approved, and now someone has to say how the switch happens: one date when every user flips to the new system, or a long series of small moves. That choice, big bang migration vs phased, shapes the risk of the project more than the target framework does.</p>
<p>For a Java desktop app the phased path has a concrete shape. Webswing runs the existing app in the browser, webforJ screens replace it one at a time inside the same tab, and every replaced screen can keep a way back to the old one until you decide to delete it.</p>
<div class="cta_UErl" role="complementary" aria-label="Moving a desktop Java app to the web?"><div class="copy_XH8h"><p class="title_HfaR">Moving a desktop Java app to the web?</p><p class="text_x4Wj">Send us a screenshot of one screen and we'll reply with how it moves to webforJ.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="mailto:sales@basis.cloud?subject=My%20app%20screen%3A%20how%20would%20it%20move%20to%20webforJ%3F&amp;body=Hi%20webforJ%20team%2C%0A%0AAttached%20is%20a%20screenshot%20of%20one%20screen%20from%20our%20app.%20It%20is%20built%20with%3A%20(Swing%2C%20JavaFX%2C%20other)%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Send a screenshot</a><a class="secondary_GDTR" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="big-bang">What a big bang cutover asks for<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#big-bang" class="hash-link" aria-label="Direct link to What a big bang cutover asks for" title="Direct link to What a big bang cutover asks for" translate="no">​</a></h2>
<p>A big bang migration builds the new app next to the old one and switches every user on a single date. It can work, but it needs things that are hard to get for a business app with years of rules in it:</p>
<ul>
<li class="">A feature freeze long enough to rebuild everything, or a second team that rebuilds while the first keeps shipping on the old app.</li>
<li class="">A full account of what the old app does, including the behavior nobody wrote down because the people who knew it have left.</li>
<li class="">A rollback plan for the whole system, because on cutover day every screen changes at once.</li>
</ul>
<p>The last point is where these projects get stuck. If one screen misbehaves after the switch, the only way back is to move every user back to the old app, together with the data they entered in the new one. That rollback is a project of its own, so teams plan around never needing it, and the cutover date turns into a deadline that can't move.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="phased">What a phased migration changes<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#phased" class="hash-link" aria-label="Direct link to What a phased migration changes" title="Direct link to What a phased migration changes" translate="no">​</a></h2>
<p>A phased migration moves users in small steps. Each step changes one screen or one workflow, ships, and runs in production before the next one starts. The old app keeps serving everything that hasn't moved yet. This is also what people mean by an incremental migration of a legacy application.</p>
<p>Each step carries its own rollback plan, and that plan is small: put that one screen back. The rest of the app didn't change, so there is little else to restore. Risk stays in the project, but it comes in pieces small enough to undo.</p>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th></th><th>Big bang</th><th>Phased</th></tr></thead><tbody><tr><td>When users switch</td><td>All at once, on one date</td><td>Screen by screen</td></tr><tr><td>The old app during the move</td><td>Frozen, then switched off</td><td>Running for every screen not yet replaced</td></tr><tr><td>Scope of a rollback</td><td>The whole system</td><td>The one screen that changed</td></tr><tr><td>Feature work</td><td>Paused, or built twice</td><td>Continues, new features ship as new screens</td></tr><tr><td>First result users see</td><td>On cutover day</td><td>With the first replaced screen</td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<p>For a desktop app, phasing has always had one hard requirement: a bridge. Users can't run half an app on the desktop and half in a browser and call it one app. Old and new screens have to live in one place and talk to each other. That bridge is Webswing plus the webforJ <code>WebswingConnector</code>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="browser-first">Step zero: the whole app in a browser<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#browser-first" class="hash-link" aria-label="Direct link to Step zero: the whole app in a browser" title="Direct link to Step zero: the whole app in a browser" translate="no">​</a></h2>
<p><a class="" href="https://docs.webforj.com/docs/integrations/webswing/overview">Webswing</a> runs a Java desktop app (Swing, JavaFX, SWT) on the server and streams its interface to the browser on an HTML5 canvas, without modifications to the original source code. Mouse and keyboard input go back to the server and are replayed on the actual app.</p>
<p>For the cutover that means two things. Every user can move to the browser before a single screen is rebuilt, which takes the desktop install off the table early. And the screens they know stay as they were, because the same Swing app is still receiving their input. Shortcuts the browser keeps for itself, such as closing or reloading the tab, are the exception.</p>
<p>The rollback plan for step zero is the desktop build itself. The app's code hasn't changed, so the installed client still works for anyone who needs it during the transition.</p>
<p>Webswing and webforJ are partners: Webswing runs the existing app in the browser, and webforJ carries it forward screen by screen through the <code>WebswingConnector</code>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="embed">Embed the old app in one view<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#embed" class="hash-link" aria-label="Direct link to Embed the old app in one view" title="Direct link to Embed the old app in one view" translate="no">​</a></h2>
<p>The connector is <code>WebswingConnector</code>, a webforJ component in the <code>webforj-webswing</code> module, available since webforJ 25.10. Put it in a view and the Webswing-hosted app renders inside your webforJ app. From that moment the browser tab belongs to webforJ. Routes, menus and new screens can grow around the embedded app while users keep working in it.</p>
<p>The <a class="" href="https://docs.webforj.com/docs/integrations/webswing/setup">setup guide</a> covers registering the app on the Webswing server and allowing your webforJ app's origin through CORS.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="one-screen">One screen cutover in practice<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#one-screen" class="hash-link" aria-label="Direct link to One screen cutover in practice" title="Direct link to One screen cutover in practice" translate="no">​</a></h2>
<p>The <a class="" href="https://docs.webforj.com/docs/integrations/webswing/tutorial">modernization tutorial</a> moves one screen of a Swing customer app to the web. The edit dialog moves. The customer table stays in Swing.</p>
<p>On the Swing side, the app detects whether it runs under Webswing and, when it does, sends an action instead of opening its own dialog:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">Application.java (Swing)</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">initWebswing</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  api </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">WebswingUtil</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getWebswingApi</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  isWebswing </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> api </span><span class="token operator" style="color:var(--dwc-code-operator)">!=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">null</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">if</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">isWebswing</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token function" style="color:var(--dwc-code-function)">setupWebswingListeners</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">handleDoubleClick</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">MouseEvent</span><span class="token plain"> e</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">int</span><span class="token plain"> row </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> table</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">rowAtPoint</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">e</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getPoint</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">if</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">row </span><span class="token operator" style="color:var(--dwc-code-operator)">&gt;=</span><span class="token plain"> </span><span class="token number" style="color:var(--dwc-code-number)">0</span><span class="token plain"> </span><span class="token operator" style="color:var(--dwc-code-operator)">&amp;&amp;</span><span class="token plain"> row </span><span class="token operator" style="color:var(--dwc-code-operator)">&lt;</span><span class="token plain"> customers</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">size</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">Customer</span><span class="token plain"> customer </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> customers</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">get</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">row</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token keyword" style="color:var(--dwc-code-keyword)">if</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">isWebswing</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      api</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">sendActionEvent</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"select-customer"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> gson</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">toJson</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">customer</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">null</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">else</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token function" style="color:var(--dwc-code-function)">showEditDialog</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">customer</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p><code>WebswingUtil.getWebswingApi()</code> returns <code>null</code> when the app runs as a regular desktop app, so one build serves both the desktop and the browser. Running the app under Webswing needs no code change. Two-way messaging does: the Webswing API dependency and a branch like this one.</p>
<p>On the webforJ side, the view that embeds the app receives the action, opens a web form and sends the saved customer back:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">CustomerTableView.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Route</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"/"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">CustomerTableView</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">extends</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Composite</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token generics class-name" style="color:var(--dwc-code-class)">FlexLayout</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">final</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">FlexLayout</span><span class="token plain"> self </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">getBoundComponent</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">CustomerTableView</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">WebswingConnector</span><span class="token plain"> connector </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">WebswingConnector</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"http://localhost:8080/myapp/"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    connector</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setSize</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"100vw"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"100vh"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    self</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">connector</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    connector</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">onAction</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">event </span><span class="token operator" style="color:var(--dwc-code-operator)">-&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token keyword" style="color:var(--dwc-code-keyword)">switch</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">event</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getActionName</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">        </span><span class="token keyword" style="color:var(--dwc-code-keyword)">case</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"select-customer"</span><span class="token operator" style="color:var(--dwc-code-operator)">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">          event</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getActionData</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">ifPresent</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">data </span><span class="token operator" style="color:var(--dwc-code-operator)">-&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">            </span><span class="token class-name" style="color:var(--dwc-code-class)">JsonObject</span><span class="token plain"> customer </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">JsonParser</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">parseString</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getAsJsonObject</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">            </span><span class="token class-name" style="color:var(--dwc-code-class)">CustomerForm</span><span class="token plain"> dialog </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">CustomerForm</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">customer</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">            self</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">dialog</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">            dialog</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">onSave</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token operator" style="color:var(--dwc-code-operator)">-&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">              </span><span class="token class-name" style="color:var(--dwc-code-class)">Gson</span><span class="token plain"> gson </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Gson</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">              connector</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">performAction</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"update-customer"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> gson</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">toJson</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">customer</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">            </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">          </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">          </span><span class="token keyword" style="color:var(--dwc-code-keyword)">break</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p><code>CustomerForm</code> is the webforJ form from the <a href="https://github.com/webforj/webforj-webswing-integration-tutorial" target="_blank" rel="noopener noreferrer" class="">tutorial source code</a>. Back in the Swing app, a browser action listener picks up <code>update-customer</code> and refreshes the table:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">Application.java (Swing)</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">setupWebswingListeners</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  api</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">addBrowserActionListener</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">event </span><span class="token operator" style="color:var(--dwc-code-operator)">-&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token keyword" style="color:var(--dwc-code-keyword)">if</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"update-customer"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">equals</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">event</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getActionName</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token class-name" style="color:var(--dwc-code-class)">Customer</span><span class="token plain"> updated </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> gson</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">fromJson</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">event</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getData</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Customer</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token function" style="color:var(--dwc-code-function)">updateCustomer</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">updated</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>The user double-clicks a row in the table they've used for years and gets the new form. The rest of the screen is unchanged. The <a class="" href="https://docs.webforj.com/docs/integrations/webswing/communication">communication guide</a> covers the remaining messaging API, including the initialize and start events that tell the webforJ side when the Swing app is ready.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="rollback">A rollback plan for every screen<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#rollback" class="hash-link" aria-label="Direct link to A rollback plan for every screen" title="Direct link to A rollback plan for every screen" translate="no">​</a></h2>
<p>Look at what the cutover left in place. <code>showEditDialog()</code> is still in the Swing code, untouched, in the <code>else</code> branch. The new form is reached only through the <code>select-customer</code> action. The way back for this one screen is therefore a change to that one branch, so the Swing app opens its own dialog again, followed by a redeploy of the Swing app. The webforJ form, the other screens and the data don't move.</p>
<p>That turns a phased migration and rollback plan into three rules per screen:</p>
<ol>
<li class="">Keep the old Swing code for a screen until its replacement has run in production long enough to trust it.</li>
<li class="">Route the cutover through one action, so the switch lives in one place.</li>
<li class="">Delete the old code only when nobody needs the way back.</li>
</ol>
<p>There is a second way back at the app level. Since the Swing app still runs as a plain desktop app when the Webswing API is absent, you can fall back to desktop deployment if needed, test new features alongside existing ones and migrate users gradually.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="users">What users notice on each step<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#users" class="hash-link" aria-label="Direct link to What users notice on each step" title="Direct link to What users notice on each step" translate="no">​</a></h2>
<p>On the phased path users switch screens, never apps. Before their screen moves, they work in the same Swing screen, now in a browser tab. When it moves, they learn one new form, and the screens around it stay the ones they know. Nobody gets a training day for a whole new system, and the feedback on each new screen arrives while the next one is still being built.</p>
<p>That feedback loop is the quiet advantage of phasing. A big bang collects every surprise on one date. A phased cutover spreads them out, one screen at a time, while the old screen is still there to compare against.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="order">Pick the order of cutovers<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#order" class="hash-link" aria-label="Direct link to Pick the order of cutovers" title="Direct link to Pick the order of cutovers" translate="no">​</a></h2>
<p>The tutorial's order is a good default for the mechanics of the move:</p>
<ol>
<li class="">Embed the whole app and replace only the edit dialog.</li>
<li class="">Add webforJ navigation and menus around the embedded app.</li>
<li class="">Replace the table with a webforJ table, and keep Swing for features that are hard to replace.</li>
<li class="">Replace the remaining Swing screens.</li>
</ol>
<p>Dialogs and forms make good first cutovers because they have a clear boundary: data comes in through one action and goes back through another. Which business area goes first is a separate decision. The <a class="" href="https://docs.webforj.com/blog/swing-modernization-enterprise">Swing modernization decision guide</a> orders screens by business value, and the <a class="" href="https://docs.webforj.com/blog/swing-to-web-migration">Swing to webforJ mapping guide</a> shows how <code>JTable</code>, <code>JOptionPane</code> and the rest translate.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="when-big-bang">When one cutover is the better call<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#when-big-bang" class="hash-link" aria-label="Direct link to When one cutover is the better call" title="Direct link to When one cutover is the better call" translate="no">​</a></h2>
<p>Phasing isn't free. The hybrid phase runs a Webswing server next to the webforJ app, and the Swing code grows a few branches for the screens in flight. For a small app with a handful of screens and a team that can rebuild it in one stretch, a single cutover can cost less than the bridge. The same goes for an app whose workflows are being redesigned from scratch, where no screen has a one-to-one replacement to switch to.</p>
<p>For a business app that can't stop, with years of rules and users who depend on it daily, the phased path is the one that keeps every step small enough to undo.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ai">Let an AI assistant build each screen<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#ai" class="hash-link" aria-label="Direct link to Let an AI assistant build each screen" title="Direct link to Let an AI assistant build each screen" translate="no">​</a></h2>
<p>Every cutover produces one new webforJ screen, which is a small, reviewable unit of work for a coding assistant. The <a class="" href="https://docs.webforj.com/docs/ai-tooling">webforJ AI plugin</a> connects the assistant to webforJ through the MCP server, which gives it live access to the documentation and validates <code>--dwc-*</code> design tokens, and Agent Skills, which give it workflows for building forms, styling apps, and creating components.</p>
<p>Ask it for a <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a> test with every screen it builds. The TestBed runs the view in a plain JUnit test with no browser and no server, so each screen comes back with a pass or a fail before you review it, and the same test guards that screen at its cutover. That's the <a class="" href="https://docs.webforj.com/blog/ai-verification-loop-java">AI verification loop</a> applied to a migration. The assistant builds the new webforJ screens. The Swing screens inside Webswing keep running unchanged until you replace them.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-slower">Is a phased migration slower than a big bang?<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#faq-slower" class="hash-link" aria-label="Direct link to Is a phased migration slower than a big bang?" title="Direct link to Is a phased migration slower than a big bang?" translate="no">​</a></h3>
<p>Total effort depends on the app. A phased plan puts the first replaced screen in front of users long before the last one is done, and you can stop after any step with a working app.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-downtime">Can we cut over a Java app without downtime risk?<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#faq-downtime" class="hash-link" aria-label="Direct link to Can we cut over a Java app without downtime risk?" title="Direct link to Can we cut over a Java app without downtime risk?" translate="no">​</a></h3>
<p>No cutover removes risk. A phased cutover keeps each change to one screen, with the old code still in place, so a problem is usually limited to that screen and the way back is short. Data a new screen has already written back to the Swing app stays written, so check it before you roll a screen back.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-swing-code">Does the Swing code have to change?<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#faq-swing-code" class="hash-link" aria-label="Direct link to Does the Swing code have to change?" title="Direct link to Does the Swing code have to change?" translate="no">​</a></h3>
<p>No, not to run it in the browser. Webswing runs it without modifications. Two-way messaging between the Swing app and webforJ needs the Webswing API dependency and a branch for each screen you move.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="first-cutover">Plan your first screen cutover<a href="https://docs.webforj.com/blog/big-bang-vs-phased-migration-java#first-cutover" class="hash-link" aria-label="Direct link to Plan your first screen cutover" title="Direct link to Plan your first screen cutover" translate="no">​</a></h2>
<p>To work out which screen moves first and how the hybrid phase runs for your app, start with the <a class="" href="https://docs.webforj.com/modernization">webforJ modernization path</a>.</p><div></div>]]></content:encoded>
            <category>Insights</category>
            <category>Modernization</category>
            <category>Webswing</category>
        </item>
        <item>
            <title><![CDATA[From 207,000 to 937: community size no longer measures a framework]]></title>
            <link>https://docs.webforj.com/blog/framework-community-size-ai-era</link>
            <guid>https://docs.webforj.com/blog/framework-community-size-ai-era</guid>
            <pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Stack Overflow questions fell from 207,000 a month to 937. Java, Spring Boot, React and every Java UI framework lost 95% or more since 2022. What that means for choosing a framework now.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-12-framework-community-size/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>Every team that evaluates a framework asks some version of the same question: if we get stuck, will we find an answer? For twenty years the honest shortcut was to look at the crowd. A big community meant many forum threads and many people who had already hit your problem. A small one meant risk.</p>
<p>That shortcut is still how most comparisons work, and it's still how AI assistants rank frameworks when you ask them. The numbers say it stopped working. Community size was only ever a proxy for one thing, knowledge reaching you when you need it, and the engine behind that proxy has stopped running for large and small frameworks alike.</p>
<p>A different question takes its place: do the people who build the framework publish what's true for the version you run, in a form your AI assistant can read and test?</p>
<div class="cta_UErl" role="complementary" aria-label="Using AI to build Java apps?"><div class="copy_XH8h"><p class="title_HfaR">Using AI to build Java apps?</p><p class="text_x4Wj">Ask the team about webforJ AI tooling: the MCP server, Agent Skills, and how they keep generated code correct.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a><a class="secondary_GDTR" href="mailto:sales@basis.cloud?subject=AI%20and%20webforJ&amp;body=Hi%20webforJ%20team%2C%0A%0A%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Ask by email</a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="forum-decline">The crowd stopped asking<a href="https://docs.webforj.com/blog/framework-community-size-ai-era#forum-decline" class="hash-link" aria-label="Direct link to The crowd stopped asking" title="Direct link to The crowd stopped asking" translate="no">​</a></h2>
<p>For most of the last fifteen years, Stack Overflow was where that knowledge lived. These are the questions asked there in each month that were still on the site on November 12, 2026, the day I wrote this. Each number links to Stack Overflow's own search, so the live count can differ a little as old questions are deleted:</p>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th>Month</th><th>All questions</th><th>Tagged <code>java</code></th></tr></thead><tbody><tr><td>March 2014</td><td><a href="https://stackoverflow.com/search?q=is%3Aquestion+created%3A2014-03-01..2014-03-31" target="_blank" rel="noopener noreferrer" class="">207,169</a></td><td><a href="https://stackoverflow.com/search?q=%5Bjava%5D+is%3Aquestion+created%3A2014-03-01..2014-03-31" target="_blank" rel="noopener noreferrer" class="">21,693</a></td></tr><tr><td>October 2022</td><td><a href="https://stackoverflow.com/search?q=is%3Aquestion+created%3A2022-10-01..2022-10-31" target="_blank" rel="noopener noreferrer" class="">105,743</a></td><td><a href="https://stackoverflow.com/search?q=%5Bjava%5D+is%3Aquestion+created%3A2022-10-01..2022-10-31" target="_blank" rel="noopener noreferrer" class="">5,212</a></td></tr><tr><td>October 2024</td><td><a href="https://stackoverflow.com/search?q=is%3Aquestion+created%3A2024-10-01..2024-10-31" target="_blank" rel="noopener noreferrer" class="">23,161</a></td><td><a href="https://stackoverflow.com/search?q=%5Bjava%5D+is%3Aquestion+created%3A2024-10-01..2024-10-31" target="_blank" rel="noopener noreferrer" class="">1,229</a></td></tr><tr><td>October 2026</td><td><a href="https://stackoverflow.com/search?q=is%3Aquestion+created%3A2026-10-01..2026-10-31" target="_blank" rel="noopener noreferrer" class="">937</a></td><td><a href="https://stackoverflow.com/search?q=%5Bjava%5D+is%3Aquestion+created%3A2026-10-01..2026-10-31" target="_blank" rel="noopener noreferrer" class="">40</a></td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<p>October 2022 is the month before <a href="https://openai.com/index/chatgpt/" target="_blank" rel="noopener noreferrer" class="">ChatGPT launched</a>. Four years later the whole site gets fewer than a thousand new questions a month, and the <code>java</code> tag gets about 40. Developers didn't stop having questions. They ask an AI assistant. In the <a href="https://survey.stackoverflow.co/2025/ai#1-ai-tools-in-the-development-process" target="_blank" rel="noopener noreferrer" class="">2025 Stack Overflow Developer Survey</a>, 84% of respondents use or plan to use AI tools in their development process.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="every-framework">Big or small, every crowd went quiet<a href="https://docs.webforj.com/blog/framework-community-size-ai-era#every-framework" class="hash-link" aria-label="Direct link to Big or small, every crowd went quiet" title="Direct link to Big or small, every crowd went quiet" translate="no">​</a></h2>
<p>If this were a story about small frameworks losing ground, the largest ones would have held up. They didn't. These are the questions asked from January to October of each year, by tag:</p>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th>Tag</th><th>2018</th><th>2022</th><th>2026</th><th>Change since 2022</th></tr></thead><tbody><tr><td>Java</td><td><a href="https://stackoverflow.com/search?q=%5Bjava%5D+is%3Aquestion+created%3A2018-01-01..2018-10-31" target="_blank" rel="noopener noreferrer" class="">122,293</a></td><td><a href="https://stackoverflow.com/search?q=%5Bjava%5D+is%3Aquestion+created%3A2022-01-01..2022-10-31" target="_blank" rel="noopener noreferrer" class="">57,742</a></td><td><a href="https://stackoverflow.com/search?q=%5Bjava%5D+is%3Aquestion+created%3A2026-01-01..2026-10-31" target="_blank" rel="noopener noreferrer" class="">1,057</a></td><td>down 98%</td></tr><tr><td>Spring Boot</td><td><a href="https://stackoverflow.com/search?q=%5Bspring-boot%5D+is%3Aquestion+created%3A2018-01-01..2018-10-31" target="_blank" rel="noopener noreferrer" class="">15,949</a></td><td><a href="https://stackoverflow.com/search?q=%5Bspring-boot%5D+is%3Aquestion+created%3A2022-01-01..2022-10-31" target="_blank" rel="noopener noreferrer" class="">14,647</a></td><td><a href="https://stackoverflow.com/search?q=%5Bspring-boot%5D+is%3Aquestion+created%3A2026-01-01..2026-10-31" target="_blank" rel="noopener noreferrer" class="">374</a></td><td>down 97%</td></tr><tr><td>Swing</td><td><a href="https://stackoverflow.com/search?q=%5Bswing%5D+is%3Aquestion+created%3A2018-01-01..2018-10-31" target="_blank" rel="noopener noreferrer" class="">2,588</a></td><td><a href="https://stackoverflow.com/search?q=%5Bswing%5D+is%3Aquestion+created%3A2022-01-01..2022-10-31" target="_blank" rel="noopener noreferrer" class="">1,254</a></td><td><a href="https://stackoverflow.com/search?q=%5Bswing%5D+is%3Aquestion+created%3A2026-01-01..2026-10-31" target="_blank" rel="noopener noreferrer" class="">55</a></td><td>down 96%</td></tr><tr><td>JavaFX</td><td><a href="https://stackoverflow.com/search?q=%5Bjavafx%5D+is%3Aquestion+created%3A2018-01-01..2018-10-31" target="_blank" rel="noopener noreferrer" class="">3,937</a></td><td><a href="https://stackoverflow.com/search?q=%5Bjavafx%5D+is%3Aquestion+created%3A2022-01-01..2022-10-31" target="_blank" rel="noopener noreferrer" class="">1,180</a></td><td><a href="https://stackoverflow.com/search?q=%5Bjavafx%5D+is%3Aquestion+created%3A2026-01-01..2026-10-31" target="_blank" rel="noopener noreferrer" class="">32</a></td><td>down 97%</td></tr><tr><td>Thymeleaf</td><td><a href="https://stackoverflow.com/search?q=%5Bthymeleaf%5D+is%3Aquestion+created%3A2018-01-01..2018-10-31" target="_blank" rel="noopener noreferrer" class="">1,115</a></td><td><a href="https://stackoverflow.com/search?q=%5Bthymeleaf%5D+is%3Aquestion+created%3A2022-01-01..2022-10-31" target="_blank" rel="noopener noreferrer" class="">586</a></td><td><a href="https://stackoverflow.com/search?q=%5Bthymeleaf%5D+is%3Aquestion+created%3A2026-01-01..2026-10-31" target="_blank" rel="noopener noreferrer" class="">5</a></td><td>down 99%</td></tr><tr><td>Vaadin</td><td><a href="https://stackoverflow.com/search?q=%5Bvaadin%5D+is%3Aquestion+created%3A2018-01-01..2018-10-31" target="_blank" rel="noopener noreferrer" class="">433</a></td><td><a href="https://stackoverflow.com/search?q=%5Bvaadin%5D+is%3Aquestion+created%3A2022-01-01..2022-10-31" target="_blank" rel="noopener noreferrer" class="">520</a></td><td><a href="https://stackoverflow.com/search?q=%5Bvaadin%5D+is%3Aquestion+created%3A2026-01-01..2026-10-31" target="_blank" rel="noopener noreferrer" class="">2</a></td><td>down 100%</td></tr><tr><td>JavaServer Faces</td><td><a href="https://stackoverflow.com/search?q=%5Bjsf%5D+is%3Aquestion+created%3A2018-01-01..2018-10-31" target="_blank" rel="noopener noreferrer" class="">1,073</a></td><td><a href="https://stackoverflow.com/search?q=%5Bjsf%5D+is%3Aquestion+created%3A2022-01-01..2022-10-31" target="_blank" rel="noopener noreferrer" class="">274</a></td><td><a href="https://stackoverflow.com/search?q=%5Bjsf%5D+is%3Aquestion+created%3A2026-01-01..2026-10-31" target="_blank" rel="noopener noreferrer" class="">12</a></td><td>down 96%</td></tr><tr><td>Google Web Toolkit</td><td><a href="https://stackoverflow.com/search?q=%5Bgwt%5D+is%3Aquestion+created%3A2018-01-01..2018-10-31" target="_blank" rel="noopener noreferrer" class="">247</a></td><td><a href="https://stackoverflow.com/search?q=%5Bgwt%5D+is%3Aquestion+created%3A2022-01-01..2022-10-31" target="_blank" rel="noopener noreferrer" class="">48</a></td><td><a href="https://stackoverflow.com/search?q=%5Bgwt%5D+is%3Aquestion+created%3A2026-01-01..2026-10-31" target="_blank" rel="noopener noreferrer" class="">0</a></td><td>down 100%</td></tr><tr><td>React</td><td><a href="https://stackoverflow.com/search?q=%5Breactjs%5D+is%3Aquestion+created%3A2018-01-01..2018-10-31" target="_blank" rel="noopener noreferrer" class="">38,817</a></td><td><a href="https://stackoverflow.com/search?q=%5Breactjs%5D+is%3Aquestion+created%3A2022-01-01..2022-10-31" target="_blank" rel="noopener noreferrer" class="">67,175</a></td><td><a href="https://stackoverflow.com/search?q=%5Breactjs%5D+is%3Aquestion+created%3A2026-01-01..2026-10-31" target="_blank" rel="noopener noreferrer" class="">204</a></td><td>down 100%</td></tr><tr><td>Angular</td><td><a href="https://stackoverflow.com/search?q=%5Bangular%5D+is%3Aquestion+created%3A2018-01-01..2018-10-31" target="_blank" rel="noopener noreferrer" class="">47,585</a></td><td><a href="https://stackoverflow.com/search?q=%5Bangular%5D+is%3Aquestion+created%3A2022-01-01..2022-10-31" target="_blank" rel="noopener noreferrer" class="">19,234</a></td><td><a href="https://stackoverflow.com/search?q=%5Bangular%5D+is%3Aquestion+created%3A2026-01-01..2026-10-31" target="_blank" rel="noopener noreferrer" class="">254</a></td><td>down 99%</td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<p>React, the largest front-end crowd of them all, went from 67,175 questions to 204. Spring Boot went from 14,647 to 374. The Java UI frameworks, old and new, all landed in the same place: a few dozen questions a year, or none.</p>
<p>Version tags don't change the picture. For Java and Spring Boot, adding tags such as <code>java-17</code> or <code>spring-boot-3</code> moves the totals by less than one percent. For Vaadin, counting all its version tags raises 2022 to 605 and leaves 2026 at 2. Deleted questions aren't counted either, and recent months have had the least time for cleanup, so if anything these numbers flatter 2026.</p>
<p>A big community no longer produces a steady stream of fresh answers, and neither does a small one.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="frozen-knowledge">What's left is frozen<a href="https://docs.webforj.com/blog/framework-community-size-ai-era#frozen-knowledge" class="hash-link" aria-label="Direct link to What's left is frozen" title="Direct link to What's left is frozen" translate="no">​</a></h2>
<p>The crowd's knowledge didn't vanish. It froze, and frozen knowledge about software ages fast.</p>
<p>Java ships a feature release <a href="https://openjdk.org/projects/jdk/" target="_blank" rel="noopener noreferrer" class="">every six months</a>, and 16 of them have shipped since Java 11 came out in September 2018.</p>
<p>Yet <a href="https://stackoverflow.com/search?q=%5Bjava%5D+is%3Aquestion+created%3A..2018-09-24" target="_blank" rel="noopener noreferrer" class="">1,413,912</a> of the 1,914,180 Java questions on Stack Overflow, 74%, were asked before Java 11 existed. 92% were asked before Java 17.</p>
<p>Spring Boot shows the same shape. <a href="https://spring.io/blog/2022/11/24/spring-boot-3-0-goes-ga" target="_blank" rel="noopener noreferrer" class="">Spring Boot 3.0</a> moved the baseline to Java 17 and Jakarta EE 9 in November 2022.</p>
<p><a href="https://stackoverflow.com/search?q=%5Bspring-boot%5D+is%3Aquestion+created%3A..2022-11-23" target="_blank" rel="noopener noreferrer" class="">125,312</a> of its 150,223 questions, 83%, were asked before that release.</p>
<p>So the bigger a framework's archive, the more of it describes versions you no longer run. A large forum footprint now mostly measures the past.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="assistants">Assistants learned from the frozen archive<a href="https://docs.webforj.com/blog/framework-community-size-ai-era#assistants" class="hash-link" aria-label="Direct link to Assistants learned from the frozen archive" title="Direct link to Assistants learned from the frozen archive" translate="no">​</a></h2>
<p>This matters because the archive is what AI assistants learned from. An assistant that answers from years of threads blends every version those threads discussed, and developers feel it. In the same <a href="https://survey.stackoverflow.co/2025/ai#2-accuracy-of-ai-tools" target="_blank" rel="noopener noreferrer" class="">2025 survey</a>, more developers distrust the accuracy of AI tools (46%) than trust it (33%). The top frustration, named by 66%, is "AI solutions that are almost right, but not quite."</p>
<p>"Almost right" is what a blend of old versions produces: code that looks familiar, compiles against an API that moved, or follows a pattern the framework replaced two releases ago. More frozen threads don't fix that. They make it more likely.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="makers">Knowledge now has to come from the makers<a href="https://docs.webforj.com/blog/framework-community-size-ai-era#makers" class="hash-link" aria-label="Direct link to Knowledge now has to come from the makers" title="Direct link to Knowledge now has to come from the makers" translate="no">​</a></h2>
<p>If the crowd no longer writes the answers, the team that builds the framework has to. And the reader is no longer only a developer. It's the developer's AI assistant. That changes what good framework knowledge looks like:</p>
<ul>
<li class=""><strong>Versioned.</strong> It answers for the release in your build file, not the average of every release ever discussed.</li>
<li class=""><strong>Machine-readable.</strong> It's published in a form an assistant can load whole, such as the <a href="https://llmstxt.org/" target="_blank" rel="noopener noreferrer" class="">llms.txt format</a>, or queried live through an open protocol like the <a href="https://modelcontextprotocol.io/" target="_blank" rel="noopener noreferrer" class="">Model Context Protocol</a>.</li>
<li class=""><strong>Checkable.</strong> It comes with a fast way for the assistant to test what it wrote, so "almost right" fails before a person reviews it.</li>
</ul>
<p>This changes who can compete. Under the old test, a newer framework could never catch up, because a crowd takes a decade to grow. Under the new one, size gives no head start.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="archive-use">What the old archive is still good for<a href="https://docs.webforj.com/blog/framework-community-size-ai-era#archive-use" class="hash-link" aria-label="Direct link to What the old archive is still good for" title="Direct link to What the old archive is still good for" translate="no">​</a></h2>
<p>The archive keeps its value for anything that doesn't change between versions. How collections behave, how threads work, how a transaction commits: an answer from 2014 on those is as right today as the day it was written.</p>
<p>Answers tied to a release are different. Configuration, annotations, build setup, and framework APIs move with every version, and that's where an old answer misleads. For those, the source has to be the people who ship the release.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="test">A better test than counting threads<a href="https://docs.webforj.com/blog/framework-community-size-ai-era#test" class="hash-link" aria-label="Direct link to A better test than counting threads" title="Direct link to A better test than counting threads" translate="no">​</a></h2>
<p>If thread counts no longer tell you anything, what does? The numbers point to a test you can run yourself in an afternoon, and it measures what a community was supposed to provide.</p>
<p>Pick one screen your app needs, such as a form with validation or a table with paging. Ask your AI assistant to build it on the current release of each framework you're considering. Then look at three things:</p>
<ol>
<li class=""><strong>Does the code match the current version?</strong> Removed APIs, old package names, and patterns the framework has replaced show that the assistant is answering from the frozen archive.</li>
<li class=""><strong>Where did the answer come from?</strong> If the makers publish versioned knowledge for assistants, the assistant can look it up and say so. If they don't, it's working from memory.</li>
<li class=""><strong>Can the assistant check itself?</strong> If it can run a test on what it wrote, an answer that's almost right fails before it reaches you.</li>
</ol>
<p>What you see in that afternoon is what your team will live with for years: the quality of the answers you get for the version you run. No community metric measures that anymore.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="takeaway">The archive isn't being refilled<a href="https://docs.webforj.com/blog/framework-community-size-ai-era#takeaway" class="hash-link" aria-label="Direct link to The archive isn't being refilled" title="Direct link to The archive isn't being refilled" translate="no">​</a></h2>
<p>The drop in questions is easy to read as a story about one website. The larger point is what it does to everything built on that website. For fifteen years, developers wrote down what each new release broke and how to fix it, and that record is what search engines indexed and AI assistants learned from. At 937 questions a month, the record has almost stopped growing. Every release from now on widens the gap between what the public archive knows and what's true.</p>
<p>Only the people who make the software can close that gap. Where they do, an assistant answers from current knowledge. Where they don't, it answers from an archive that ages a little more with every release, however large the community once was.</p>
<p>webforJ shows what that looks like. It's the full-stack Java framework for business web apps, where you build the whole app, screens included, in Java. Its 24.00 release came out in April 2024, after the forums had already gone quiet, so it was designed for this from the start. Its knowledge ships with the framework: an <a class="" href="https://docs.webforj.com/docs/ai-tooling">AI plugin</a> answers for the exact version in your project, and a <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a> lets the assistant test what it wrote.</p>
<p>So the question to ask of any framework has changed. It used to be how many people are talking about it. Now it's whether its makers are writing down what's true for the version you'll run next year.</p><div></div>]]></content:encoded>
            <category>Insights</category>
            <category>AI</category>
        </item>
        <item>
            <title><![CDATA[JSF to Angular migration: what the rewrite really adds]]></title>
            <link>https://docs.webforj.com/blog/jsf-to-angular-migration</link>
            <guid>https://docs.webforj.com/blog/jsf-to-angular-migration</guid>
            <pubDate>Thu, 12 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Planning a JSF to Angular migration or a JSF to React rewrite? See what the new stack adds to a Java team, and the option to rebuild the UI in Java with webforJ.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-12-jsf-to-angular-migration/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>Your team runs a JSF app that does real work. The screens are dated, the component library is getting harder to upgrade, and someone has been asked for a plan. Most of the advice you find points to Angular or to React.</p>
<p>This post is for the team about to start a JSF to Angular migration, or a JSF to React migration. It lists what that rewrite adds to a Java team, when it is the right call, and a third option: rebuild the UI in Java with webforJ and keep the Java backend and the Java team you already have.</p>
<div class="cta_UErl" role="complementary" aria-label="Moving a desktop Java app to the web?"><div class="copy_XH8h"><p class="title_HfaR">Moving a desktop Java app to the web?</p><p class="text_x4Wj">Send us a screenshot of one screen and we'll reply with how it moves to webforJ.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="mailto:sales@basis.cloud?subject=My%20app%20screen%3A%20how%20would%20it%20move%20to%20webforJ%3F&amp;body=Hi%20webforJ%20team%2C%0A%0AAttached%20is%20a%20screenshot%20of%20one%20screen%20from%20our%20app.%20It%20is%20built%20with%3A%20(Swing%2C%20JavaFX%2C%20other)%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Send a screenshot</a><a class="secondary_GDTR" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-search-suggests-a-rewrite">Why the usual advice is a rewrite<a href="https://docs.webforj.com/blog/jsf-to-angular-migration#why-search-suggests-a-rewrite" class="hash-link" aria-label="Direct link to Why the usual advice is a rewrite" title="Direct link to Why the usual advice is a rewrite" translate="no">​</a></h2>
<p>Most advice on leaving JSF points to Angular or React, so it is easy to read that as the default answer. Both are solid choices for many products. In both, the UI code is written in JavaScript or TypeScript and runs in the browser.</p>
<p>That last part is what matters for a JSF team. Moving to either one is not an upgrade of the view layer. It is a new front end, in a new language, next to the Java app.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-the-rewrite-adds">What the rewrite adds to your stack<a href="https://docs.webforj.com/blog/jsf-to-angular-migration#what-the-rewrite-adds" class="hash-link" aria-label="Direct link to What the rewrite adds to your stack" title="Direct link to What the rewrite adds to your stack" translate="no">​</a></h2>
<p>A JSF page and its backing bean run on the server, in the same JVM as your services. The bean calls a service with a plain method call. A browser front end can't do that. Here is what the rewrite adds:</p>
<ol>
<li class=""><strong>A second language.</strong> Angular apps are written in TypeScript, and React components are JavaScript functions. Your Java developers learn a new language, or you hire people who know it.</li>
<li class=""><strong>A REST layer.</strong> Every screen that reads or writes data now needs endpoints, JSON shapes on both sides, and access checks on each endpoint. In JSF none of this existed, because the bean and the service sat in the same process.</li>
<li class=""><strong>A second build.</strong> The front end has its own package manager, its own build and its own deployment, next to Maven or Gradle.</li>
<li class=""><strong>A second team.</strong> Front end and back end often drift into separate roles, separate backlogs and separate releases. A feature that touches a screen and its data now crosses the API boundary.</li>
</ol>
<p>None of these is a flaw in Angular or React. They are the shape of a client-side front end. The <a class="" href="https://docs.webforj.com/blog/cost-separate-frontend-backend-teams">cost of separate frontend and backend teams</a> post has a worksheet for putting your own numbers on points 2 to 4.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="when-a-rewrite-fits">When a rewrite is the right call<a href="https://docs.webforj.com/blog/jsf-to-angular-migration#when-a-rewrite-fits" class="hash-link" aria-label="Direct link to When a rewrite is the right call" title="Direct link to When a rewrite is the right call" translate="no">​</a></h2>
<p>A rewrite to a JavaScript front end makes sense when:</p>
<ul>
<li class="">You already have a front-end team that knows the framework.</li>
<li class="">The backend already exposes a public API that mobile apps or partners use.</li>
<li class="">The product is a consumer site where the wider JavaScript ecosystem matters more than staying in one language.</li>
</ul>
<p>If that describes your team, rewrite JSF in Angular or React with a clear plan. The <a class="" href="https://docs.webforj.com/blog/react-with-java-backend">React with a Java backend</a> post walks through what that stack involves in practice.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="rebuild-the-ui-in-java">Rebuild the UI in Java instead<a href="https://docs.webforj.com/blog/jsf-to-angular-migration#rebuild-the-ui-in-java" class="hash-link" aria-label="Direct link to Rebuild the UI in Java instead" title="Direct link to Rebuild the UI in Java instead" translate="no">​</a></h2>
<p>Many JSF teams fit none of the preceding cases. They are Java developers maintaining a business app with forms, tables, and workflows. For them there is a third road: keep the server-side model, drop the XHTML, and write each screen as a Java class with webforJ.</p>
<p>The JSF app still gets a new UI. The backend and the team stay. A view receives your services through its constructor and calls them directly:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Route</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"/dashboard"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">DashboardView</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">extends</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Composite</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token generics class-name" style="color:var(--dwc-code-class)">Div</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">final</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Div</span><span class="token plain"> self </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">getBoundComponent</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">final</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">MetricsService</span><span class="token plain"> metricsService</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">DashboardView</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">MetricsService</span><span class="token plain"> metricsService</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token keyword" style="color:var(--dwc-code-keyword)">this</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token plain">metricsService </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> metricsService</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token comment" style="color:var(--dwc-code-comment);font-style:italic">// Use injected services to build UI</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">Div</span><span class="token plain"> metricsPanel </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Div</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    metricsPanel</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">metricsService</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getCurrentMetrics</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    self</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">metricsPanel</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>There is no endpoint between the view and <code>MetricsService</code>. With Spring Boot, your services, repositories and configuration work as normal, and <a class="" href="https://docs.webforj.com/docs/integrations/spring/routing">Spring routing</a> injects them into each view. Existing Spring Data repositories plug into webforJ tables through the <a class="" href="https://docs.webforj.com/docs/integrations/spring/spring-data-jpa">Spring Data JPA integration</a> without modification.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-stays-and-what-changes">What stays and what changes<a href="https://docs.webforj.com/blog/jsf-to-angular-migration#what-stays-and-what-changes" class="hash-link" aria-label="Direct link to What stays and what changes" title="Direct link to What stays and what changes" translate="no">​</a></h2>
<p>What stays:</p>
<ul>
<li class="">Entities, services and repositories.</li>
<li class="">Jakarta Bean Validation constraints on your model. A <code>BindingContext</code> applies them to the bound fields through <a class="" href="https://docs.webforj.com/docs/data-binding/validation/jakarta-validation">Jakarta Validation</a>.</li>
<li class="">The language, the build tool and the people.</li>
</ul>
<p>What changes:</p>
<ul>
<li class="">Facelets XHTML views become Java classes.</li>
<li class="">Most backing beans fold into the view.</li>
<li class="">EL expressions become <code>BindingContext</code> bindings between fields and bean properties.</li>
</ul>
<p>The concept-by-concept mapping already has its own posts. For Faces views, beans, EL and validators, read the <a class="" href="https://docs.webforj.com/blog/jsf-alternative">JSF to Spring Boot migration</a> guide. For rich component libraries, read the <a class="" href="https://docs.webforj.com/blog/primefaces-alternative">PrimeFaces alternative</a> post.</p>
<p>For JSP pages, the same choice applies. A JSP to React migration adds the same four things as a JSF rewrite. The <a class="" href="https://docs.webforj.com/blog/jsp-modernization">JSP modernization</a> post maps scriptlets, JSTL loops, includes and tag libraries to a Java component tree.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="plan-the-move">Plan the move in five steps<a href="https://docs.webforj.com/blog/jsf-to-angular-migration#plan-the-move" class="hash-link" aria-label="Direct link to Plan the move in five steps" title="Direct link to Plan the move in five steps" translate="no">​</a></h2>
<p>Whichever road you pick, the order of work is similar. For the Java road:</p>
<ol>
<li class=""><strong>List the screens.</strong> Note which ones are simple forms, which are tables, and which carry heavy templating.</li>
<li class=""><strong>Pull logic out of the beans.</strong> Anything that is business logic moves into a service, if it is not there already. This step pays off on any road.</li>
<li class=""><strong>Pick one leaf screen.</strong> A single form or report with few links to other pages is a good first port.</li>
<li class=""><strong>Port it and compare.</strong> Build the webforJ view, wire it to the same service, and check it against the JSF screen with the people who use it.</li>
<li class=""><strong>Repeat, heaviest last.</strong> Move the next screens behind a shared route layout, and leave the most templated pages for the end.</li>
</ol>
<p>The <a class="" href="https://docs.webforj.com/blog/legacy-java-modernization-strategy">legacy Java modernization strategy</a> post covers how to rank screens by value and risk across a whole estate.</p>
<p>An AI assistant can speed up steps 3 to 5. The <a class="" href="https://docs.webforj.com/docs/ai-tooling">webforJ AI plugin</a> gives it live access to the webforJ docs while it writes the new views.</p>
<p>Ask it for a <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a> test with every view it ports. The TestBed runs the view in a plain JUnit test, with no browser and no server, so each port comes back with a pass or a fail before you review it. That is the <a class="" href="https://docs.webforj.com/blog/ai-verification-loop-java">AI verification loop</a>. You still review each view before it ships.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/jsf-to-angular-migration#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-react">Does it matter which front end you pick?<a href="https://docs.webforj.com/blog/jsf-to-angular-migration#faq-react" class="hash-link" aria-label="Direct link to Does it matter which front end you pick?" title="Direct link to Does it matter which front end you pick?" translate="no">​</a></h3>
<p>A JSF to React migration and a JSF to Angular migration differ in the details, not in the shape. In both, the UI code is written in JavaScript or TypeScript, and both need an API between the screens and your Java services.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-rest">Will my backend need a REST API?<a href="https://docs.webforj.com/blog/jsf-to-angular-migration#faq-rest" class="hash-link" aria-label="Direct link to Will my backend need a REST API?" title="Direct link to Will my backend need a REST API?" translate="no">​</a></h3>
<p>Not for the screens. A webforJ view calls your Java services directly, so the services the JSF beans call today stay as they are. An Angular or React rewrite needs an API between those services and the new screens.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-team">Can the team that maintains the JSF app do the work?<a href="https://docs.webforj.com/blog/jsf-to-angular-migration#faq-team" class="hash-link" aria-label="Direct link to Can the team that maintains the JSF app do the work?" title="Direct link to Can the team that maintains the JSF app do the work?" translate="no">​</a></h3>
<p>Yes. The new screens are Java classes built from components, events and bindings, so the developers who know the JSF app and its services can build them without learning a second language first.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="plan-your-jsf-move">Plan your JSF move with our team<a href="https://docs.webforj.com/blog/jsf-to-angular-migration#plan-your-jsf-move" class="hash-link" aria-label="Direct link to Plan your JSF move with our team" title="Direct link to Plan your JSF move with our team" translate="no">​</a></h2>
<p>To plan the move with the people who build webforJ, start at <a class="" href="https://docs.webforj.com/modernization">modernization</a>.</p><div></div>]]></content:encoded>
            <category>Insights</category>
            <category>Modernization</category>
            <category>Front End</category>
            <category>Spring</category>
        </item>
        <item>
            <title><![CDATA[The Business Case for a Java UI Framework: What Your Boss Will Ask]]></title>
            <link>https://docs.webforj.com/blog/business-case-java-ui-framework</link>
            <guid>https://docs.webforj.com/blog/business-case-java-ui-framework</guid>
            <pubDate>Wed, 11 Nov 2026 12:00:00 GMT</pubDate>
            <description><![CDATA[The business case for a Java UI framework, plus a legacy system risk assessment for a Java app: the risks a board weighs and how a phased path reduces each.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-11-business-case-java-ui-framework/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>You have looked at webforJ and you like what you see. Now somebody with a budget or a veto wants to know why the team should adopt it, and "the developers prefer it" isn't an answer that survives a meeting.</p>
<p>This post is the business case for a Java UI framework, written as the questions a decision-maker asks, with a plain answer to each. webforJ is the full-stack Java framework for business web apps: you build the whole app, screens included, in Java. Each answer below links the page you can hand to your manager. If the framework is meant to replace an old Java app, the post also works as a legacy system risk assessment: the risks of staying, the risks of moving, and how a phased path reduces each one.</p>
<div class="cta_UErl" role="complementary" aria-label="Moving a desktop Java app to the web?"><div class="copy_XH8h"><p class="title_HfaR">Moving a desktop Java app to the web?</p><p class="text_x4Wj">Send us a screenshot of one screen and we'll reply with how it moves to webforJ.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="mailto:sales@basis.cloud?subject=My%20app%20screen%3A%20how%20would%20it%20move%20to%20webforJ%3F&amp;body=Hi%20webforJ%20team%2C%0A%0AAttached%20is%20a%20screenshot%20of%20one%20screen%20from%20our%20app.%20It%20is%20built%20with%3A%20(Swing%2C%20JavaFX%2C%20other)%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Send a screenshot</a><a class="secondary_GDTR" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="who-is-behind">Who is behind the framework?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#who-is-behind" class="hash-link" aria-label="Direct link to Who is behind the framework?" title="Direct link to Who is behind the framework?" translate="no">​</a></h2>
<p>webforJ is built by BASIS International, which has built development tools <a href="https://basis.cloud/about/" target="_blank" rel="noopener noreferrer" class="">since 1985</a>. The company is privately owned and operated.</p>
<p>BASIS operates its own sites in North America and Europe and works with partners in more than 30 countries. For the maturity question in full, read <a class="" href="https://docs.webforj.com/blog/is-webforj-production-ready">Is webforJ production ready</a>, and for the customers, <a class="" href="https://docs.webforj.com/blog/who-uses-webforj">Who uses webforJ</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="convince-my-boss">How do I convince my boss to adopt a Java framework?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#convince-my-boss" class="hash-link" aria-label="Direct link to How do I convince my boss to adopt a Java framework?" title="Direct link to How do I convince my boss to adopt a Java framework?" translate="no">​</a></h2>
<p>Show that the decision keeps what the company already has. The team stays a Java team, the code stays Java, and the screens stop needing a second language and a second set of specialists.</p>
<p>That's the whole argument, and it's qualitative on purpose. With webforJ, components, routing, forms with data binding, tables and route security come from one framework, so standard screens don't need a JavaScript codebase beside the Java one. Fewer languages and fewer hand-offs mean fewer places for a project to stall. Our <a class="" href="https://docs.webforj.com/blog/why-webforj">why webforJ</a> post makes the wider case.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="justify-a-framework-choice">How do I justify a framework choice?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#justify-a-framework-choice" class="hash-link" aria-label="Direct link to How do I justify a framework choice?" title="Direct link to How do I justify a framework choice?" translate="no">​</a></h2>
<p>Judge it against the risks the board will name, not against a feature list. Most boards ask about the same few: vendor, upgrades, fit, existing code, lock-in, quality and the cost of being wrong. The sections below take them in turn, and the last one turns the rest into a small experiment.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-risks">What risks will the architecture board ask about?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#what-risks" class="hash-link" aria-label="Direct link to What risks will the architecture board ask about?" title="Direct link to What risks will the architecture board ask about?" translate="no">​</a></h2>
<p>The vendor, the upgrade path and the fit with your app come first, followed by existing code, lock-in and testing. The sections below answer each one. If webforJ is meant to replace a legacy Java app, the <a href="https://docs.webforj.com/blog/business-case-java-ui-framework#legacy-risk-assessment" class="">risk assessment</a> adds the risks of the move itself.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="releases-and-upgrades">How often does it ship, and how do upgrades work?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#releases-and-upgrades" class="hash-link" aria-label="Direct link to How often does it ship, and how do upgrades work?" title="Direct link to How often does it ship, and how do upgrades work?" translate="no">​</a></h2>
<p>webforJ follows a published release model. Major releases occur annually, minor releases roughly every six to eight weeks, and patches ship when critical bugs or security fixes need them. The <a class="" href="https://docs.webforj.com/docs/upgrading/overview">upgrading guides</a> describe each type and what to expect from it.</p>
<p>Major releases may require adjustments to an app, so the project gives you tools for that. Snapshot builds are available before most releases so you can test early, and OpenRewrite recipes handle <a class="" href="https://docs.webforj.com/docs/upgrading/automated-upgrades">automated upgrades</a> by renaming APIs, updating dependencies and flagging the fixes left for a person.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="does-it-fit">Does it fit our kind of app?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#does-it-fit" class="hash-link" aria-label="Direct link to Does it fit our kind of app?" title="Direct link to Does it fit our kind of app?" translate="no">​</a></h2>
<p>If the app is a business app, yes. webforJ is made for forms, tables, navigation, role-based access and the other screens that business software consists of, and it covers them in Java. The <a class="" href="https://docs.webforj.com/blog/when-to-use-webforj">when to use webforJ</a> guide lists the projects it fits and the ones it doesn't.</p>
<p>Your data layer is yours. The <a class="" href="https://docs.webforj.com/docs/integrations/spring/overview">Spring Boot integration</a> lets components receive your Spring beans, and the <a class="" href="https://docs.webforj.com/docs/advanced/repository/overview">repository pattern</a> connects tables to Spring Data and JPA entities, or to data outside your app such as a REST API. If your team uses Spring already, it keeps using it.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="existing-code-and-team">What happens to our existing code and team?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#existing-code-and-team" class="hash-link" aria-label="Direct link to What happens to our existing code and team?" title="Direct link to What happens to our existing code and team?" translate="no">​</a></h2>
<p>Both stay. A webforJ developer is a Java developer, so you hire for Java and onboard to the framework. Our post on the <a class="" href="https://docs.webforj.com/blog/webforj-learning-curve">webforJ learning curve</a> walks through what a Swing or Spring developer already knows, and why candidates don't need webforJ on their CV.</p>
<p>The same holds for code. If a Swing, JavaFX or SWT desktop app holds years of business rules, the <a class="" href="https://docs.webforj.com/docs/integrations/webswing/overview">Webswing integration</a> runs it in the browser without changes to its source and embeds it inside a webforJ app. You then replace screens one at a time, and the old and new screens stay connected during the move. The full path is in <a class="" href="https://docs.webforj.com/blog/swing-to-web-migration">Swing to web migration</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="avoid-lock-in">How do we avoid lock-in?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#avoid-lock-in" class="hash-link" aria-label="Direct link to How do we avoid lock-in?" title="Direct link to How do we avoid lock-in?" translate="no">​</a></h2>
<p>Keep the framework in the views and nowhere else. Every UI framework shapes the screens written against it, so what you control is how much of the app knows about the framework.</p>
<p>With webforJ, business rules can live in plain Java classes or Spring services, forms can bind to plain beans validated by Jakarta Validation, and data can come through repositories. In that layout only the views use webforJ components, so the part you would redo if you ever left is the thin part. The post on how to <a class="" href="https://docs.webforj.com/blog/avoid-ui-framework-lock-in">avoid UI framework lock-in</a> shows the split layer by layer.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-do-we-test">How do we test it?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#how-do-we-test" class="hash-link" aria-label="Direct link to How do we test it?" title="Direct link to How do we test it?" translate="no">​</a></h2>
<p>With the tools your team already uses. Unit tests run in JUnit, and end-to-end tests run with Selenium or Playwright. The <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a> runs views in plain JUnit tests without a browser or a server. Our <a class="" href="https://docs.webforj.com/blog/java-web-app-testing-strategy">testing strategy</a> post shows which layer to use for what.</p>
<p>That matters to a manager for a plain reason: the app goes through the same build and the same CI checks as the rest of your Java code. Nothing about the UI needs a separate quality process.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="legacy-risk-assessment">Legacy Java risk assessment<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#legacy-risk-assessment" class="hash-link" aria-label="Direct link to Legacy Java risk assessment" title="Direct link to Legacy Java risk assessment" translate="no">​</a></h2>
<p>When the new framework is meant to replace an old Java app, the board's question changes from "is this framework safe" to "is the move safe." A legacy system risk assessment answers it in two lists: what you risk by staying, and what you risk by moving. Rate each risk high, medium or low for your own app, with the business owner and the engineering lead in the same room. Leave out any figure you can't source.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="risks-of-staying">The risks of staying<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#risks-of-staying" class="hash-link" aria-label="Direct link to The risks of staying" title="Direct link to The risks of staying" translate="no">​</a></h3>
<ul>
<li class=""><strong>The platform runs out.</strong> Old runtimes and frameworks stop receiving fixes, and the app can't move until its dependencies do. A phased path takes the most-used screens off the old platform first, so exposure shrinks with each release instead of all at once at the end.</li>
<li class=""><strong>The knowledge leaves.</strong> The people who know why the app behaves as it does move on, and the code becomes the only record. Each rebuilt screen turns part of that knowledge into current Java code with a test, while those people are still around to review it.</li>
<li class=""><strong>Audit findings pile up.</strong> Installed desktop clients and unsupported frameworks come back in every security review. For a desktop app, running it in the browser through Webswing replaces many installed clients with one server-side deployment. New screens get route security from the framework.</li>
<li class=""><strong>Hiring gets harder.</strong> Fewer developers want to work on an old view technology. New screens are written in current Java, so the job ad stays a Java job ad.</li>
</ul>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="risks-of-moving">The risks of moving<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#risks-of-moving" class="hash-link" aria-label="Direct link to The risks of moving" title="Direct link to The risks of moving" translate="no">​</a></h3>
<ul>
<li class=""><strong>The rewrite fails.</strong> This is the risk most boards remember. A phased path has no single cutover. Each screen is a small deliverable, and the program can stop after any phase with something gained.</li>
<li class=""><strong>The business stops.</strong> The old app keeps running and shipping while screens move. A desktop app runs in the browser through Webswing, and a web app keeps its old pages until each replacement is accepted.</li>
<li class=""><strong>Users lose their workflow.</strong> Users keep the screens they know until the new one is ready, and you choose the order, so the screens with the most to gain go first.</li>
<li class=""><strong>Business rules change by accident.</strong> The Java services stay and the new views call them directly, so the rules aren't re-implemented. A TestBed test checks each new screen in plain JUnit before it ships.</li>
<li class=""><strong>AI-written code is wrong.</strong> An assistant can draft new webforJ screens, but drafts need proof. <a class="" href="https://docs.webforj.com/blog/ai-verification-loop-java">The AI verification loop for Java</a> checks the API, compiles each edit and tests the screen, and a person still reviews it. No tool converts the old screens for you.</li>
<li class=""><strong>The supplier stalls.</strong> Releases follow a published cadence, OpenRewrite recipes handle most of a major upgrade from webforJ 26 on and leave TODO comments where no direct replacement exists, and keeping webforJ in the views limits what you would redo if you left.</li>
<li class=""><strong>The budget runs out midway.</strong> Each phase stands on its own, so a cut budget leaves you with fewer moved screens, not with half an app.</li>
</ul>
<p>None of this removes risk. It turns one large bet into a series of small ones, each with a result the board can see before it funds the next.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="run-a-pilot">How do I run a pilot?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#run-a-pilot" class="hash-link" aria-label="Direct link to How do I run a pilot?" title="Direct link to How do I run a pilot?" translate="no">​</a></h2>
<p>Pick one real screen, not a demo. Choose a screen from your own app that people use and that a manager recognizes, such as a customer search, an order form, or a status dashboard. A screen from the app, rather than a todo list, makes the result easy to judge.</p>
<p>Then choose a time box that fits your team, tell your manager the date up front, and build that one screen in webforJ against your existing services. The <a class="" href="https://docs.webforj.com/docs/introduction/getting-started">getting started guide</a> covers project creation, and startforJ generates a Maven project you can open in your usual IDE. If the screen belongs to a desktop app, run the old app under Webswing and replace that single screen next to it.</p>
<p>At the end, show three things:</p>
<ul>
<li class="">The screen running in the browser, next to the one it replaces or complements.</li>
<li class="">The Java source, so your manager can see one language and one project.</li>
<li class="">The test and the build, running in the same pipeline as everything else.</li>
</ul>
<p>Then take the open questions from this post back to the board with an actual result attached. A small pilot doesn't commit the company to anything, and it gives the architecture board something concrete to approve or reject.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-convince-boss">How do I convince my boss to adopt a Java framework?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#faq-convince-boss" class="hash-link" aria-label="Direct link to How do I convince my boss to adopt a Java framework?" title="Direct link to How do I convince my boss to adopt a Java framework?" translate="no">​</a></h3>
<p>Show that it keeps the team, the language and the existing code, and run a pilot on one real screen so the result is visible.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-justify">How do I justify a framework choice?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#faq-justify" class="hash-link" aria-label="Direct link to How do I justify a framework choice?" title="Direct link to How do I justify a framework choice?" translate="no">​</a></h3>
<p>Answer the risks the board will name: vendor, release cadence, fit, existing code, lock-in and testing. Each has a documented answer for webforJ in the preceding sections.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-risks">What risks will the architecture board ask about?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#faq-risks" class="hash-link" aria-label="Direct link to What risks will the architecture board ask about?" title="Direct link to What risks will the architecture board ask about?" translate="no">​</a></h3>
<p>Usually the vendor, upgrades, lock-in, hiring, and quality. BASIS has built development tools since 1985, releases follow a published cadence, and the framework fits into a normal Java build.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-legacy-risk">How do you assess the risk of a legacy Java system?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#faq-legacy-risk" class="hash-link" aria-label="Direct link to How do you assess the risk of a legacy Java system?" title="Direct link to How do you assess the risk of a legacy Java system?" translate="no">​</a></h3>
<p>List the risks of staying, such as an ending platform, lost knowledge, and audit findings, next to the risks of moving, such as a failed rewrite, a stopped business, and changed rules. Rate each for your app, then check how a phased path reduces it.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-pilot">How do I run a pilot?<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#faq-pilot" class="hash-link" aria-label="Direct link to How do I run a pilot?" title="Direct link to How do I run a pilot?" translate="no">​</a></h3>
<p>Choose one real screen, set a time box, build it against your existing services and show the screen, the source, and the passing build.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="pick-the-pilot">Pick the pilot screen this week<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#pick-the-pilot" class="hash-link" aria-label="Direct link to Pick the pilot screen this week" title="Direct link to Pick the pilot screen this week" translate="no">​</a></h2>
<p>Write down one screen from your own app that a manager would recognize, agree a time box, and ask for approval for that screen alone. A single working screen answers more questions in a meeting than any slide.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="talk-with-us">Talk through your app with us<a href="https://docs.webforj.com/blog/business-case-java-ui-framework#talk-with-us" class="hash-link" aria-label="Direct link to Talk through your app with us" title="Direct link to Talk through your app with us" translate="no">​</a></h2>
<p>When the pilot screen is picked, the <a class="" href="https://docs.webforj.com/modernization">modernization page</a> shows the path for the whole app and how to talk to us about it.</p><div></div>]]></content:encoded>
            <category>Insights</category>
            <category>Modernization</category>
            <category>Spring</category>
        </item>
        <item>
            <title><![CDATA[webforJ JavaScript Integration: Use the Libraries You Already Have]]></title>
            <link>https://docs.webforj.com/blog/webforj-javascript-integration</link>
            <guid>https://docs.webforj.com/blog/webforj-javascript-integration</guid>
            <pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[webforJ JavaScript integration explained for evaluators: wrap web components in Java, run client-side JavaScript, load scripts, and bring npm packages and React, Svelte or Lit components.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-11-webforj-javascript-integration/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>A Java framework that builds the whole screen in Java raises a fair worry for anyone choosing it: what happens the day you need a charting library, a date picker or a widget your team already owns, and it's written in JavaScript? Do you wait for the framework to ship its own version?</p>
<p>You don't. This post covers webforJ JavaScript integration: the documented ways to bring the JavaScript ecosystem into a webforJ app, and which one fits which job. webforJ is the full-stack Java framework for business web apps: you build the whole app, screens included, in Java. The standard app needs no JavaScript at all, and when you want some, there are four clear routes in.</p>
<div class="cta_UErl" role="complementary" aria-label="Connecting webforJ to your stack?"><div class="copy_XH8h"><p class="title_HfaR">Connecting webforJ to your stack?</p><p class="text_x4Wj">Ask the team about your libraries, services, and build.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="https://docs.webforj.com/startforj/" target="_blank" rel="noopener noreferrer">Start your app<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a><a class="secondary_GDTR" href="mailto:sales@basis.cloud?subject=Integrating%20webforJ&amp;body=Hi%20webforJ%20team%2C%0A%0A%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Ask by email</a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-libraries">Can I use JavaScript libraries with webforJ?<a href="https://docs.webforj.com/blog/webforj-javascript-integration#faq-libraries" class="hash-link" aria-label="Direct link to Can I use JavaScript libraries with webforJ?" title="Direct link to Can I use JavaScript libraries with webforJ?" translate="no">​</a></h2>
<p>Yes. Every route below keeps your screens in Java and lets a script, a stylesheet, a web component, or an npm package join them. You choose the route by what you are bringing:</p>
<ul>
<li class="">A web component becomes a typed Java class.</li>
<li class="">A script or stylesheet you already have gets attached to a component or to the app.</li>
<li class="">A single browser call runs straight from Java.</li>
<li class="">An npm package or a React, Svelte or Lit component goes through the frontend bundler.</li>
</ul>
<p>You can mix them in one app, and each can be adopted on its own.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="element-composite">Wrap a web component in Java<a href="https://docs.webforj.com/blog/webforj-javascript-integration#element-composite" class="hash-link" aria-label="Direct link to Wrap a web component in Java" title="Direct link to Wrap a web component in Java" translate="no">​</a></h2>
<p><a class="" href="https://docs.webforj.com/docs/building-ui/element-composite">ElementComposite</a> wraps a custom HTML element or third-party web component in a Java class. Its properties, attributes and events become part of the Java API, so the rest of your team calls <code>setX()</code> and <code>getX()</code> on a normal class and never touches the underlying element.</p>
<p>A wrapper declares the tag it wraps and the script and stylesheet the component depends on, with the <code>@NodeName</code>, <code>@JavaScript</code> and <code>@StyleSheet</code> annotations. webforJ deduplicates script loads, so several components can depend on the same script without loading it twice. Events work the same way: you register listeners from Java, with options such as debouncing, throttling, and filtering.</p>
<p>This is the route for a component library you want to use across many screens. You write the wrapper once, and from then on the component behaves like any built-in one. Our post on <a class="" href="https://docs.webforj.com/blog/web-components-in-java">web components in Java</a> walks through the idea in more depth.</p>
<p>If a built-in component already covers the need, such as a text field or a button, use that instead. For a one-off piece of DOM work that nobody will reuse, the <code>Element</code> class can be used directly without a wrapper.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="execute-javascript">Run JavaScript from Java<a href="https://docs.webforj.com/blog/webforj-javascript-integration#execute-javascript" class="hash-link" aria-label="Direct link to Run JavaScript from Java" title="Direct link to Run JavaScript from Java" translate="no">​</a></h2>
<p>Sometimes you don't need a component, just one call in the browser: scroll the window, focus a field, read a browser value or call a method on a web component. <a class="" href="https://docs.webforj.com/docs/building-ui/execute-javascript">Execute JavaScript</a> covers that with <code>executeJs</code>, <code>executeJsAsync</code> and <code>executeJsVoidAsync</code>. They work at two levels. <code>Page</code> runs a script in the context of the whole page, and an <code>Element</code> runs a script scoped to a single client element.</p>
<p>The three methods differ in whether the calling thread waits and whether a result comes back. Fire-and-forget calls return nothing. The asynchronous form returns a <code>PendingResult</code>, so Java can react when the browser answers, and returned values arrive as matching Java types such as <code>String</code>, <code>Boolean</code> and numbers.</p>
<p>This is the lightest route. It suits glue code, not whole widgets.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="managing-resources">Load scripts and styles<a href="https://docs.webforj.com/blog/webforj-javascript-integration#managing-resources" class="hash-link" aria-label="Direct link to Load scripts and styles" title="Direct link to Load scripts and styles" translate="no">​</a></h2>
<p>If you already have a script or a stylesheet, <a class="" href="https://docs.webforj.com/docs/managing-resources/importing-assets">Importing Assets</a> attaches it to a component or the app with annotations. There is no build step, no npm, and no compile. The same page covers inline scripts and styles and how they load, and the <a class="" href="https://docs.webforj.com/docs/managing-resources/overview">Managing Resources</a> section also covers runtime injection of resources, custom URL protocols and file downloads.</p>
<p>Choose this route when the asset is already built: a vendor script served from a URL, a company stylesheet or a bundle another team publishes.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="bundler">Bring npm packages and components<a href="https://docs.webforj.com/blog/webforj-javascript-integration#bundler" class="hash-link" aria-label="Direct link to Bring npm packages and components" title="Direct link to Bring npm packages and components" translate="no">​</a></h2>
<p>The <a class="" href="https://docs.webforj.com/docs/managing-resources/bundler/overview">frontend bundler</a>, available since 26.01, lets a class draw on the <a href="https://www.npmjs.com/" target="_blank" rel="noopener noreferrer" class="">npm</a> ecosystem and write components in React, Svelte or Lit, all from a Java project with no Node toolchain to install or run. A class names the frontend it needs with <code>@BundleEntry</code> and <code>@BundlePackage</code>. The build installs the packages, compiles the sources and loads the result when a component of that class is created.</p>
<p>The bundler runs as part of the <a class="" href="https://docs.webforj.com/docs/configuration/build-plugin">webforJ build plugin</a> for Maven or Gradle. It also handles SCSS, Less and Tailwind through <a class="" href="https://docs.webforj.com/docs/managing-resources/bundler/extensions/overview">extensions</a>, and it can run frontend tests as part of the build. Because the annotations sit on the class, the frontend a view needs travels with the view.</p>
<p>It's opt in. A project that already uses the asset annotations keeps them unchanged and adds the bundler only where a package, a compiled source, or a test calls for it. A step-by-step example of <a class="" href="https://docs.webforj.com/blog/npm-packages-java-web-app">installing an npm package in a Java app</a> shows it end to end. The <a class="" href="https://docs.webforj.com/docs/managing-resources/bundler/npm-and-assets">packages and assets page</a> explains how packages and entries work.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ready-made">Ready-made integrations<a href="https://docs.webforj.com/blog/webforj-javascript-integration#ready-made" class="hash-link" aria-label="Direct link to Ready-made integrations" title="Direct link to Ready-made integrations" translate="no">​</a></h2>
<p>Some wrapped libraries ship as webforJ components. The <a class="" href="https://docs.webforj.com/docs/components/google-charts">GoogleChart</a> component integrates the Google Charts library, so you configure bar, line, pie and geo charts in Java with a type, a data set, and an options map. No script tag or wrapper is involved.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="which-route">Which route fits?<a href="https://docs.webforj.com/blog/webforj-javascript-integration#which-route" class="hash-link" aria-label="Direct link to Which route fits?" title="Direct link to Which route fits?" translate="no">​</a></h2>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th>You have</th><th>Use</th><th>Build step</th></tr></thead><tbody><tr><td>A third-party web component</td><td>ElementComposite</td><td>None</td></tr><tr><td>One browser action to trigger</td><td>Execute JavaScript</td><td>None</td></tr><tr><td>A built script or stylesheet</td><td>Asset annotations</td><td>None</td></tr><tr><td>An npm package</td><td>Frontend bundler</td><td>Yes, by the build plugin</td></tr><tr><td>A React, Svelte or Lit component</td><td>Frontend bundler</td><td>Yes, by the build plugin</td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<p>The routes stack. A common shape is a bundler entry that registers a custom element, Java that consumes it, and an occasional script call for the odd browser action.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-npm">Can I use npm packages in a webforJ app?<a href="https://docs.webforj.com/blog/webforj-javascript-integration#faq-npm" class="hash-link" aria-label="Direct link to Can I use npm packages in a webforJ app?" title="Direct link to Can I use npm packages in a webforJ app?" translate="no">​</a></h2>
<p>Yes. Declare the package and version with <code>@BundlePackage</code>, point <code>@BundleEntry</code> at the file under <code>src/main/frontend</code> that imports it, and the build installs and compiles it. The build plugin manages Bun for you, so you install nothing extra.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-react">Can I use a React component in webforJ?<a href="https://docs.webforj.com/blog/webforj-javascript-integration#faq-react" class="hash-link" aria-label="Direct link to Can I use a React component in webforJ?" title="Direct link to Can I use a React component in webforJ?" translate="no">​</a></h2>
<p>Yes. The bundler lets you write components in React, Svelte or Lit and consume them from Java, with the compiled output loaded when a component of that class is created. The entry registers a custom element, and the Java side consumes it with <code>Element</code> and listens to its events. A worked example shows how to <a class="" href="https://docs.webforj.com/blog/wrap-react-component-java">wrap a React component in Java</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-no-js">Do I have to write JavaScript to use webforJ?<a href="https://docs.webforj.com/blog/webforj-javascript-integration#faq-no-js" class="hash-link" aria-label="Direct link to Do I have to write JavaScript to use webforJ?" title="Direct link to Do I have to write JavaScript to use webforJ?" translate="no">​</a></h2>
<p>No. Components, routing, forms, tables and security are written in Java. JavaScript enters only when you choose to bring a library or a script, and then through the routes in this post.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="next-step">Pick your first integration<a href="https://docs.webforj.com/blog/webforj-javascript-integration#next-step" class="hash-link" aria-label="Direct link to Pick your first integration" title="Direct link to Pick your first integration" translate="no">​</a></h2>
<p>Start with the library you already know you need. If it ships as a web component, read the <a class="" href="https://docs.webforj.com/docs/building-ui/element-composite">ElementComposite guide</a>. If it's an npm package or a React, Svelte or Lit component, read the <a class="" href="https://docs.webforj.com/docs/managing-resources/bundler/overview">frontend bundler overview</a>. If it's a script you've already built, the <a class="" href="https://docs.webforj.com/docs/managing-resources/importing-assets">asset annotations</a> attach it in one line.</p><div></div>]]></content:encoded>
            <category>Integrations</category>
            <category>JavaScript</category>
            <category>Web Development</category>
        </item>
        <item>
            <title><![CDATA[Java applet replacement: your options after JDK 25]]></title>
            <link>https://docs.webforj.com/blog/java-applet-replacement</link>
            <guid>https://docs.webforj.com/blog/java-applet-replacement</guid>
            <pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Applets were removed from the JDK in JDK 26. Compare each Java applet replacement option, from Webswing in the browser to a rebuild in Java with webforJ.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-10-java-applet-replacement/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>Somewhere in your company an applet still does real work. Maybe it's the order entry screen a branch office opens in an old browser profile, or a planning tool that lives inside a locked-down virtual desktop because nothing else will start it. It kept running because nobody touched it. That grace period is over, and finding a Java applet replacement is no longer a job you can push to next year.</p>
<p>JDK 25 is the last Java release that ships the Applet API. JDK 26 removed it. This post sets out the dates, what the removal breaks, and the options you can stand behind: keep the applet reachable in a browser through Webswing while you plan, or rebuild its screens as a webforJ app in Java, with the Java team you already have.</p>
<div class="cta_UErl" role="complementary" aria-label="Moving a desktop Java app to the web?"><div class="copy_XH8h"><p class="title_HfaR">Moving a desktop Java app to the web?</p><p class="text_x4Wj">Send us a screenshot of one screen and we'll reply with how it moves to webforJ.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="mailto:sales@basis.cloud?subject=My%20app%20screen%3A%20how%20would%20it%20move%20to%20webforJ%3F&amp;body=Hi%20webforJ%20team%2C%0A%0AAttached%20is%20a%20screenshot%20of%20one%20screen%20from%20our%20app.%20It%20is%20built%20with%3A%20(Swing%2C%20JavaFX%2C%20other)%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Send a screenshot</a><a class="secondary_GDTR" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="removal-timeline">Applets removed from the JDK: the dates<a href="https://docs.webforj.com/blog/java-applet-replacement#removal-timeline" class="hash-link" aria-label="Direct link to Applets removed from the JDK: the dates" title="Direct link to Applets removed from the JDK: the dates" translate="no">​</a></h2>
<p>The removal came in steps, spread over almost a decade:</p>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th>Release</th><th>What changed</th></tr></thead><tbody><tr><td>JDK 9 (2017)</td><td>Applet API and the <code>appletviewer</code> tool deprecated (JEP 289)</td></tr><tr><td>JDK 11 (2018)</td><td><code>appletviewer</code> removed, and the browser deployment stack for applets and Web Start removed</td></tr><tr><td>JDK 17 (2021)</td><td>Applet API deprecated for removal (JEP 398)</td></tr><tr><td>JDK 24 (2025)</td><td>Security Manager, which sandboxed applet code, permanently disabled (JEP 486)</td></tr><tr><td>JDK 25 (GA September 16, 2025)</td><td>The last release that still contains the Applet API</td></tr><tr><td>JDK 26 (GA March 17, 2026)</td><td>Applet API removed (JEP 504)</td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<p><a href="https://openjdk.org/jeps/504" target="_blank" rel="noopener noreferrer" class="">JDK Enhancement Proposal (JEP) 504</a> states the reason plainly: neither recent JDK releases nor current web browsers support applets. Since <code>appletviewer</code> left in JDK 11, there has been no way to run an applet with the JDK itself. The removal shipped in <a href="https://openjdk.org/projects/jdk/26/" target="_blank" rel="noopener noreferrer" class="">JDK 26</a>, so every JDK from 26 on is applet-free.</p>
<p>Java Web Start, the usual sibling of the applet, left earlier. The <a href="https://www.oracle.com/java/technologies/javase/11-relnote-issues.html" target="_blank" rel="noopener noreferrer" class="">JDK 11 release notes</a> say the deployment stack required for applets and Web Start applications "has been removed in JDK 11."</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-breaks">What the removal breaks<a href="https://docs.webforj.com/blog/java-applet-replacement#what-breaks" class="hash-link" aria-label="Direct link to What the removal breaks" title="Direct link to What the removal breaks" translate="no">​</a></h2>
<p>JEP 504 deletes the whole <code>java.applet</code> package: <code>Applet</code>, <code>AppletContext</code>, <code>AppletStub</code> and <code>AudioClip</code>. It also removes <code>javax.swing.JApplet</code> and <code>java.beans.AppletInitializer</code>, along with the methods and fields that reference them in <code>java.beans.Beans</code> and <code>javax.swing.RepaintManager</code>.</p>
<p>For a business app that means:</p>
<ul>
<li class="">A class that extends <code>Applet</code> or <code>JApplet</code> no longer compiles against JDK 26 or later.</li>
<li class="">Code that casts the result of <code>URL.getContent()</code> to <code>AudioClip</code> no longer compiles or runs, as the JEP spells out.</li>
<li class="">A shared library that still references these classes ties every app that uses it to JDK 25 or older.</li>
</ul>
<p>The JEP is blunt about the choice left to you. Applications that still use the Applet API "will either stay on older releases or will migrate to some other API." If your applet also blocks the move off an old runtime for the rest of the estate, the cost of waiting is already on the table, as the post on <a class="" href="https://docs.webforj.com/blog/java-swing-technical-debt">Java Swing technical debt</a> lays out for desktop Java in general.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-replaces-applets">What replaces Java applets<a href="https://docs.webforj.com/blog/java-applet-replacement#what-replaces-applets" class="hash-link" aria-label="Direct link to What replaces Java applets" title="Direct link to What replaces Java applets" translate="no">​</a></h2>
<p>There are four answers you can defend in front of an architect and a budget holder. Two of them buy time. Two of them move the app forward.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="stay-on-older-jdk">Stay on JDK 25 or older<a href="https://docs.webforj.com/blog/java-applet-replacement#stay-on-older-jdk" class="hash-link" aria-label="Direct link to Stay on JDK 25 or older" title="Direct link to Stay on JDK 25 or older" translate="no">​</a></h3>
<p>This is the answer the JEP names first, and for a few months it can be the right one. It doesn't make the applet work in a modern browser, though. Browser plug-ins are long gone, and the JDK has had no applet runner since JDK 11. Staying put keeps the code compiling. It does nothing for the users who need to reach the screens, and every year on an old release makes the eventual move larger.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="desktop-app">Turn the applet into a desktop app<a href="https://docs.webforj.com/blog/java-applet-replacement#desktop-app" class="hash-link" aria-label="Direct link to Turn the applet into a desktop app" title="Direct link to Turn the applet into a desktop app" translate="no">​</a></h3>
<p>JEP 504 points out that where the <code>Applet</code> class only serves as a user interface container, the AWT API offers alternatives. In practice, the content of a <code>JApplet</code> can move into a <code>JFrame</code> and compile on a current JDK. The price is that you are back to delivering and updating a desktop app on every machine, and Java Web Start, the tool that used to do that from a link, has been out of the JDK since Java 11. For an internal tool used by a handful of people, that can be fine. For an app your customers or field staff open from a browser, it's a step backwards.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="run-with-webswing">Run the applet in the browser with Webswing<a href="https://docs.webforj.com/blog/java-applet-replacement#run-with-webswing" class="hash-link" aria-label="Direct link to Run the applet in the browser with Webswing" title="Direct link to Run the applet in the browser with Webswing" translate="no">​</a></h3>
<p>Webswing documents applets as a supported launcher type. In the <a href="https://www.webswing.org/docs/26.2/configure/applet" target="_blank" rel="noopener noreferrer" class="">Webswing applet configuration</a>, you set up the applet much like a Swing app, choose <code>Applet</code> as the launcher type, and name the applet class that extends <code>java.applet.Applet</code>, plus any applet parameters. The same page lists embedding into your web page and a Java to JavaScript interface. Webswing runs the app on the server and shows its interface in the browser, so users get a URL instead of a plug-in.</p>
<p>One fact keeps this option honest. The applet class still extends <code>java.applet.Applet</code>, so the Java runtime that runs it on the server has to be one that still ships the Applet API, which means JDK 25 or older. The <a href="https://www.webswing.org/docs/26.2/" target="_blank" rel="noopener noreferrer" class="">Webswing documentation</a> lists Java 8, 11, 17, 21 and 25 as supported, so the versions it runs on still include that API. It buys time without touching the applet's source. It doesn't remove the dependency on the Applet API.</p>
<p>Webswing and webforJ are partners. Webswing keeps the old app reachable today, and webforJ carries it forward.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="rebuild-in-webforj">Rebuild the applet's screens in webforJ<a href="https://docs.webforj.com/blog/java-applet-replacement#rebuild-in-webforj" class="hash-link" aria-label="Direct link to Rebuild the applet's screens in webforJ" title="Direct link to Rebuild the applet's screens in webforJ" translate="no">​</a></h3>
<p>This is the option that ends the deadline for good. An applet is a Java program with an AWT or Swing user interface. webforJ is a full-stack Java framework where the screens are also Java: <a class="" href="https://docs.webforj.com/docs/architecture/controls-components">components are Java objects</a>, events are listeners, and layouts are composed in Java code. The app runs on the server and users open it in any current browser. Nothing has to be installed on the desktop.</p>
<p>Most applet concepts have a direct counterpart:</p>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th>Applet</th><th>webforJ</th></tr></thead><tbody><tr><td>A class that extends <code>JApplet</code></td><td>A view class with a <code>@Route</code> annotation</td></tr><tr><td><code>init()</code> builds the component tree</td><td>The view's constructor builds the component tree</td></tr><tr><td><code>&lt;param&gt;</code> tags read with <code>getParameter()</code></td><td>Route parameters or <a class="" href="https://docs.webforj.com/docs/routing/query-parameters">query parameters</a> read from the URL</td></tr><tr><td>An <code>ActionListener</code> on a <code>JButton</code></td><td>An <code>onClick</code> listener on a <code>Button</code></td></tr><tr><td><code>JOptionPane.showMessageDialog</code></td><td><code>OptionDialog.showMessageDialog</code></td></tr><tr><td>HTTP calls back to a servlet for data</td><td>Direct calls to your Java services, because the view already runs on the server</td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<p>The last row is where many applet teams save the most work. If your applet loaded and saved data through a servlet, the webforJ view can call the same Java service code directly. There is no endpoint or JSON contract in between. If the server side runs on Spring, the <a class="" href="https://docs.webforj.com/docs/integrations/spring/overview">Spring integration</a> is built so that your Spring services, repositories, and configuration work as normal. The rules your business learned the hard way stay in Java.</p>
<p>Your developers keep the mental model they already have. They build screens without writing JavaScript, and they don't need to hire for a second stack. The <a class="" href="https://docs.webforj.com/blog/swing-to-web-migration">Swing to webforJ mapping guide</a> shows the same idea in more depth, since a <code>JApplet</code> is a Swing container inside a browser page.</p>
<p>The new screens also come with tooling that checks the rebuild as it goes. The <a class="" href="https://docs.webforj.com/docs/ai-tooling">webforJ AI plugin</a> gives your coding assistant the real webforJ API, so it writes against the framework instead of guessing.</p>
<p>Ask it for a <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a> test with every screen it rebuilds. The TestBed runs the view in a plain JUnit test with no browser and no server, so each screen comes back with a pass or a fail before you review it. That's the <a class="" href="https://docs.webforj.com/blog/ai-verification-loop-java">AI verification loop</a>. These tools work on the webforJ screens you build, not on the old applet.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="pick-a-path">Pick the path by situation<a href="https://docs.webforj.com/blog/java-applet-replacement#pick-a-path" class="hash-link" aria-label="Direct link to Pick the path by situation" title="Direct link to Pick the path by situation" translate="no">​</a></h2>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th>Your situation</th><th>Path</th></tr></thead><tbody><tr><td>Users must keep reaching the applet while you plan</td><td>Run it through Webswing, on JDK 25 or older behind it</td></tr><tr><td>The applet has a handful of screens</td><td>Rebuild it in webforJ directly</td></tr><tr><td>The applet is large and the business can't pause</td><td>Keep it running in Webswing while the team rebuilds it in webforJ, then retire it</td></tr><tr><td>A few people use it on one machine</td><td>Move it into a desktop window on a current JDK</td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<p>For a large applet, the order of work matters more than the tool. List the screens, rank them by how often people use them, and rebuild the most used one first while the rest keep running. The <a class="" href="https://docs.webforj.com/blog/migrate-swing-app-to-web">Swing to web migration guide</a> walks through that choice for desktop Java, and the same reasoning holds for an applet.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/java-applet-replacement#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-modern-browser">Can I still run a Java applet in a modern browser?<a href="https://docs.webforj.com/blog/java-applet-replacement#faq-modern-browser" class="hash-link" aria-label="Direct link to Can I still run a Java applet in a modern browser?" title="Direct link to Can I still run a Java applet in a modern browser?" translate="no">​</a></h3>
<p>Not through a browser plug-in. Browsers dropped plug-in support years ago, and JEP 504 notes that no current browser supports applets. Webswing documents a way to run an applet on the server and show it in the browser, but that applet still needs a Java runtime with the Applet API behind it.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-last-jdk">Is JDK 25 the last version with applets?<a href="https://docs.webforj.com/blog/java-applet-replacement#faq-last-jdk" class="hash-link" aria-label="Direct link to Is JDK 25 the last version with applets?" title="Direct link to Is JDK 25 the last version with applets?" translate="no">​</a></h3>
<p>Yes. JEP 504 removed the Applet API in JDK 26, which reached general availability on March 17, 2026. JDK 25 is the last release that contains <code>java.applet</code> and <code>javax.swing.JApplet</code>.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-full-rewrite">Does a Java applet replacement mean a full rewrite?<a href="https://docs.webforj.com/blog/java-applet-replacement#faq-full-rewrite" class="hash-link" aria-label="Direct link to Does a Java applet replacement mean a full rewrite?" title="Direct link to Does a Java applet replacement mean a full rewrite?" translate="no">​</a></h3>
<p>Not of the whole app. With webforJ you rebuild the user interface in Java, and the Java classes that hold your rules, calculations, and data access carry over. The work is mostly separating the screen code from the logic it calls.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-web-start">What happens to JNLP apps?<a href="https://docs.webforj.com/blog/java-applet-replacement#faq-web-start" class="hash-link" aria-label="Direct link to What happens to JNLP apps?" title="Direct link to What happens to JNLP apps?" translate="no">​</a></h3>
<p>Java Web Start, which launched JNLP apps, left the JDK with Java 11, together with the browser deployment stack. Web Start delivered desktop Java apps from a link, so the same rebuild path in webforJ applies to their screens.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="plan-your-applet-replacement">Plan your applet replacement<a href="https://docs.webforj.com/blog/java-applet-replacement#plan-your-applet-replacement" class="hash-link" aria-label="Direct link to Plan your applet replacement" title="Direct link to Plan your applet replacement" translate="no">​</a></h2>
<p>Bring your list of applet screens to the <a class="" href="https://docs.webforj.com/modernization">modernization page</a>, see how the move works in phases, and talk to us about your app.</p><div></div>]]></content:encoded>
            <category>Insights</category>
            <category>Modernization</category>
            <category>Webswing</category>
        </item>
        <item>
            <title><![CDATA[Why webforJ? Straight Answers to Questions Java Teams Ask]]></title>
            <link>https://docs.webforj.com/blog/why-webforj</link>
            <guid>https://docs.webforj.com/blog/why-webforj</guid>
            <pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Why webforJ for your next business web app? What sets it apart, why we built it, who stands behind it, and how it fits your backend and your own components.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-10-why-webforj/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>Your Java team has a new business web app to build, and the shortlist of frameworks keeps growing. Every option promises productivity, so the useful question is the one developers keep asking in public: why webforJ, and what do you get that you would not get elsewhere?</p>
<p>Here are straight answers. webforJ is the full-stack Java framework for business web apps: you build the whole app, screens included, in Java. The rest of this post shows what that means in practice, why we built it, and how it fits the backend, the tools, and the components you already have.</p>
<div class="cta_UErl" role="complementary" aria-label="Already running Spring Boot?"><div class="copy_XH8h"><p class="title_HfaR">Already running Spring Boot?</p><p class="text_x4Wj">Ask the team how webforJ fits into your existing Spring app.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a><a class="secondary_GDTR" href="mailto:sales@basis.cloud?subject=webforJ%20with%20Spring%20Boot&amp;body=Hi%20webforJ%20team%2C%0A%0A%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Ask by email</a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="different">What makes webforJ different?<a href="https://docs.webforj.com/blog/why-webforj#different" class="hash-link" aria-label="Direct link to What makes webforJ different?" title="Direct link to What makes webforJ different?" translate="no">​</a></h2>
<p>Writing a web UI in Java is the starting point, not the answer. What sets webforJ apart is everything it puts around that code.</p>
<ol>
<li class=""><strong>Your AI assistant's work gets checked.</strong> An AI plugin teaches coding tools the real API, browserless tests give them a pass or a fail, and an in-app assistant compiles every edit before you see it.</li>
<li class=""><strong>Your desktop apps come along.</strong> Swing, JavaFX and SWT apps run in the browser today and move to web screens one at a time.</li>
<li class=""><strong>You edit the app while it runs.</strong> Live editing changes the running app and writes the result back into your Java source.</li>
<li class=""><strong>Your backend stays yours.</strong> webforJ runs standalone or with Spring Boot, and data comes from Spring Data or from any source you choose.</li>
<li class=""><strong>The whole stack is Java.</strong> Components, routing, forms, tables, security, translation and tests come from one framework, built by one team.</li>
</ol>
<p>The sections below go through each one, with the documentation behind it.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="full-stack">Everything in one Java framework<a href="https://docs.webforj.com/blog/why-webforj#full-stack" class="hash-link" aria-label="Direct link to Everything in one Java framework" title="Direct link to Everything in one Java framework" translate="no">​</a></h2>
<p>A business app needs far more than buttons. webforJ covers the list in Java:</p>
<ul>
<li class=""><strong>Components and routing.</strong> You compose screens from <a class="" href="https://docs.webforj.com/docs/building-ui/overview">components</a> and define pages with <a class="" href="https://docs.webforj.com/docs/routing/overview">routes</a>.</li>
<li class=""><strong>Forms.</strong> <a class="" href="https://docs.webforj.com/docs/data-binding/overview">Data binding</a> connects components to your Java models with two-way synchronization, validation and transformation.</li>
<li class=""><strong>Tables.</strong> The <a class="" href="https://docs.webforj.com/docs/components/table/overview">Table</a> component binds an entity class to a repository to populate columns and rows.</li>
<li class=""><strong>Security.</strong> <a class="" href="https://docs.webforj.com/docs/security/overview">Route security</a> protects views with declarative annotations and central authentication and authorization.</li>
<li class=""><strong>Translation.</strong> The built-in <a class="" href="https://docs.webforj.com/docs/advanced/i18n-localization">translation system</a> looks up localized strings by key and detects the browser locale.</li>
<li class=""><strong>Testing.</strong> The <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a> runs views in plain JUnit tests, with no browser and no server.</li>
</ul>
<p>Because it's one framework, these pieces share the same conventions. For a deeper walk through the stack, read our guide to the <a class="" href="https://docs.webforj.com/blog/java-full-stack-framework">full-stack Java framework</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-built">Why we built webforJ<a href="https://docs.webforj.com/blog/why-webforj#why-built" class="hash-link" aria-label="Direct link to Why we built webforJ" title="Direct link to Why we built webforJ" translate="no">​</a></h2>
<p>Java teams run business-critical software. They know the domain, the data and the build tools, and the browser shouldn't force them to staff a second codebase in another language. We built webforJ so that the same Java skills carry the app from the database to the screen.</p>
<p>That goal shaped the framework. webforJ handles the user interface in Java while your services, repositories, and configuration stay yours. With Spring on the classpath, Spring handles backend concerns and webforJ handles the screens. For standard components there is no second codebase in JavaScript to staff and maintain, so fewer moving parts need to stay current.</p>
<p>The same goal explains the desktop story. Many organizations have years of business logic in Java desktop apps that can't be rewritten overnight. We wanted those teams to reach the web without throwing that work away.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="who-is-behind">Who is behind webforJ?<a href="https://docs.webforj.com/blog/why-webforj#who-is-behind" class="hash-link" aria-label="Direct link to Who is behind webforJ?" title="Direct link to Who is behind webforJ?" translate="no">​</a></h2>
<p>webforJ is built by BASIS International. <a href="https://webforj.com/company" target="_blank" rel="noopener noreferrer" class="">BASIS</a> software and software tools have been used to develop business solutions for both large international corporations and SMEs for almost 40 years, with 20+ years of delivering technology built on Java.</p>
<p>Operating its own sites in North America and Europe and working with partners in more than 30 countries, BASIS is well positioned on the international stage.</p>
<p>Releases are regular and public. Version 24.00 went live on April 8, 2024, and 26.02 followed on August 31, 2026, with artifacts on Maven Central. The full case, with the release record and customer stories, is in <a class="" href="https://docs.webforj.com/blog/is-webforj-production-ready">Is webforJ production ready</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="any-backend">Does it work with any backend?<a href="https://docs.webforj.com/blog/why-webforj#any-backend" class="hash-link" aria-label="Direct link to Does it work with any backend?" title="Direct link to Does it work with any backend?" translate="no">​</a></h2>
<p>Yes. You choose the backend, and webforJ adapts to it.</p>
<p>You can run webforJ standalone, or add <a class="" href="https://docs.webforj.com/docs/integrations/spring/spring-boot">Spring Boot</a> through the same startforJ generator. With Spring, your components can inject any Spring bean through the constructor, and your routes keep working exactly as in a plain app.</p>
<p>Data follows the same freedom. <a class="" href="https://docs.webforj.com/docs/integrations/spring/spring-data-jpa">Spring Data JPA</a> repositories connect to tables through <code>SpringDataRepository</code>. Data that lives elsewhere, such as a REST API or an external service, connects through a <a class="" href="https://docs.webforj.com/docs/advanced/repository/delegating-repository">custom data source</a> with <code>DelegatingRepository</code>, where you supply the find, count and key-lookup functions.</p>
<p>Nothing here ties you to one persistence layer or one service style. The wider picture, from built-in components to npm packages and the Java ecosystem, is covered in <a class="" href="https://docs.webforj.com/blog/webforj-ecosystem">how big the webforJ ecosystem is</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="own-components">Can I use my own components?<a href="https://docs.webforj.com/blog/why-webforj#own-components" class="hash-link" aria-label="Direct link to Can I use my own components?" title="Direct link to Can I use my own components?" translate="no">​</a></h2>
<p>Yes. webforJ's own components are built on web components, so wrapping a third-party custom element uses the same mechanism in the open. With <a class="" href="https://docs.webforj.com/docs/building-ui/element-composite"><code>ElementComposite</code></a> you expose the element's properties, attributes and events through a typed Java class and use it like any other component.</p>
<p>JavaScript isn't off limits either. You can <a class="" href="https://docs.webforj.com/docs/building-ui/execute-javascript">run client-side JavaScript from Java</a>, and the <a class="" href="https://docs.webforj.com/docs/managing-resources/bundler/overview">frontend bundler</a> lets a class draw on npm packages and write components in React, Svelte or Lit from a Java project.</p>
<p>To see the full wrapping pattern from script loading to typed events, read <a class="" href="https://docs.webforj.com/blog/web-components-in-java">Web components in Java</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ai-ready">Ready for AI-assisted development<a href="https://docs.webforj.com/blog/why-webforj#ai-ready" class="hash-link" aria-label="Direct link to Ready for AI-assisted development" title="Direct link to Ready for AI-assisted development" translate="no">​</a></h2>
<p>AI coding tools are fast, and their output still needs checking. webforJ gives them three ways to check.</p>
<ul>
<li class=""><strong>The AI plugin.</strong> The <a class="" href="https://docs.webforj.com/docs/ai-tooling">webforJ AI plugin</a> installs the MCP server and Agent Skills in one step for Claude Code, Copilot, Cursor, Gemini and Codex. The MCP server gives the assistant live access to the knowledge base, and the skills teach it which workflows to follow.</li>
<li class=""><strong>Browserless tests.</strong> The TestBed lets an assistant run a view in a JUnit test and get a clear pass or fail.</li>
<li class=""><strong>An assistant in the running app.</strong> The <a class="" href="https://docs.webforj.com/docs/ai-tooling/craftforj-assistant">craftforJ Assistant</a> writes Java, compiles each edit before you see it, and applies it to the running app.</li>
</ul>
<p>Together they form a loop of write, check, and review. We cover it in <a class="" href="https://docs.webforj.com/blog/ai-verification-loop-java">the AI verification loop for Java</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="for-developers">Built for developers<a href="https://docs.webforj.com/blog/why-webforj#for-developers" class="hash-link" aria-label="Direct link to Built for developers" title="Direct link to Built for developers" translate="no">​</a></h2>
<p>A framework should make the team faster on day one and keep it fast. That's why webforJ comes with tools around the code.</p>
<ul>
<li class=""><strong>One language, one team.</strong> The same Java developers who write the services write the screens.</li>
<li class=""><strong>A project generator.</strong> <a class="" href="https://docs.webforj.com/docs/introduction/getting-started">startforJ</a> creates a Maven project from an archetype with the dependencies and a pre-made layout.</li>
<li class=""><strong>Live editing.</strong> <a class="" href="https://docs.webforj.com/docs/craftforj">craftforJ</a> shows the component tree of your running app, lets you change properties live, and writes the changes you keep back into your Java source.</li>
<li class=""><strong>One design system.</strong> The DWC <a class="" href="https://docs.webforj.com/docs/styling/overview">design system</a> ships built-in <a class="" href="https://docs.webforj.com/docs/styling/themes">themes</a> and an official Figma kit, so designers and developers work from the same tokens and components.</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="swing-to-web">From Swing to the web<a href="https://docs.webforj.com/blog/why-webforj#swing-to-web" class="hash-link" aria-label="Direct link to From Swing to the web" title="Direct link to From Swing to the web" translate="no">​</a></h2>
<p>If your business runs on a Swing, JavaFX or SWT desktop app, you don't have to rewrite it to reach the browser. The <a class="" href="https://docs.webforj.com/docs/integrations/webswing/overview">Webswing integration</a> runs those apps in a web browser without changes to the source, and the <code>WebswingConnector</code> component embeds them inside a webforJ app.</p>
<p>From there the move is gradual. You build new screens in webforJ around the embedded app, replace old screens one at a time, and phase out the legacy app when you are ready. During the move the old and new screens stay connected, because the connector supports <a class="" href="https://docs.webforj.com/docs/integrations/webswing/communication">two-way communication</a>: your webforJ app sends actions to the Swing app and receives its events.</p>
<p>The full migration path is in <a class="" href="https://docs.webforj.com/blog/swing-to-web-migration">Swing to web migration</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/why-webforj#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-different">What makes webforJ different?<a href="https://docs.webforj.com/blog/why-webforj#faq-different" class="hash-link" aria-label="Direct link to What makes webforJ different?" title="Direct link to What makes webforJ different?" translate="no">​</a></h3>
<p>webforJ is the full-stack Java framework for business web apps, and it's built for how teams work now. AI assistants get their work checked against the real API and by browserless tests, existing Swing apps move to the web one screen at a time, and the whole app, screens included, stays in Java.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-who-behind">Who is behind webforJ?<a href="https://docs.webforj.com/blog/why-webforj#faq-who-behind" class="hash-link" aria-label="Direct link to Who is behind webforJ?" title="Direct link to Who is behind webforJ?" translate="no">​</a></h3>
<p>BASIS International. BASIS software and software tools have been used to develop business solutions for both large international corporations and SMEs for almost 40 years, with 20+ years of delivering technology built on Java.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-backend">Does webforJ lock me into one backend?<a href="https://docs.webforj.com/blog/why-webforj#faq-backend" class="hash-link" aria-label="Direct link to Does webforJ lock me into one backend?" title="Direct link to Does webforJ lock me into one backend?" translate="no">​</a></h3>
<p>No. webforJ runs standalone or with Spring Boot, works with Spring Data repositories, and connects to any other data source through a custom repository.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-components">Can I use my own web components?<a href="https://docs.webforj.com/blog/why-webforj#faq-components" class="hash-link" aria-label="Direct link to Can I use my own web components?" title="Direct link to Can I use my own web components?" translate="no">​</a></h3>
<p>Yes. <code>ElementComposite</code> wraps any custom element as a typed Java component, and you can also run JavaScript from Java or bundle npm packages.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-ai">Can AI assistants build with webforJ?<a href="https://docs.webforj.com/blog/why-webforj#faq-ai" class="hash-link" aria-label="Direct link to Can AI assistants build with webforJ?" title="Direct link to Can AI assistants build with webforJ?" translate="no">​</a></h3>
<p>Yes. The webforJ AI plugin gives assistants the MCP server and Agent Skills, and the TestBed and the craftforJ Assistant check the result.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="start">Start a project with startforJ<a href="https://docs.webforj.com/blog/why-webforj#start" class="hash-link" aria-label="Direct link to Start a project with startforJ" title="Direct link to Start a project with startforJ" translate="no">​</a></h2>
<p>The quickest way to judge these answers is to build something. Generate a project with <a href="https://docs.webforj.com/startforj" target="_blank" rel="noopener noreferrer" class="">startforJ</a>, follow the <a class="" href="https://docs.webforj.com/docs/introduction/getting-started">getting started guide</a>, and build one real screen of your own app in Java.</p>
<p>If you are still comparing options, <a class="" href="https://docs.webforj.com/blog/java-framework-for-web-applications">Java framework for web applications</a> lists what to require from any of them. The decisions a team settles first are laid out in <a class="" href="https://docs.webforj.com/blog/starting-new-java-project">starting a new Java project</a>.</p><div></div>]]></content:encoded>
            <category>Insights</category>
            <category>Web Development</category>
            <category>Spring</category>
        </item>
        <item>
            <title><![CDATA[Who Uses webforJ? Customer Stories From Real Projects]]></title>
            <link>https://docs.webforj.com/blog/who-uses-webforj</link>
            <guid>https://docs.webforj.com/blog/who-uses-webforj</guid>
            <pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Who uses webforJ in production? The published webforJ customer stories, Prodin and b+p, with their team size, timeline and user counts, plus who builds webforJ.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-10-who-uses-webforj/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>A team that is about to pick a framework wants to know who already runs it. Logos on a landing page don't help much. What helps is knowing which companies built what, how big the team was, and how long it took.</p>
<p>So, who uses webforJ? Two full customer stories are published, one about Prodin and one about b+p, and both name webforJ as the framework behind the project. Prodin is Prodin Business Solutions, a Dutch software provider for enterprise resource planning (ERP). b+p is an HR consulting firm in Southwest Germany. Here is what each team built, how many people it took, and how long it took.</p>
<div class="cta_UErl" role="complementary" aria-label="Working on something similar?"><div class="copy_XH8h"><p class="title_HfaR">Working on something similar?</p><p class="text_x4Wj">Ask the webforJ team. Questions are welcome, big or small.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a><a class="secondary_GDTR" href="mailto:sales@basis.cloud?subject=Question%20about%20webforJ&amp;body=Hi%20webforJ%20team%2C%0A%0A%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Ask by email</a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="which-companies">Which companies use webforJ?<a href="https://docs.webforj.com/blog/who-uses-webforj#which-companies" class="hash-link" aria-label="Direct link to Which companies use webforJ?" title="Direct link to Which companies use webforJ?" translate="no">​</a></h2>
<p>Two customer stories are on our <a href="https://webforj.com/success-stories/" target="_blank" rel="noopener noreferrer" class="">success stories page</a>:</p>
<ol>
<li class=""><strong>Prodin</strong> moved a Swing-based Java ERP app to the browser.</li>
<li class=""><strong>b+p</strong> delivered an employee survey for the University of Saarland.</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="prodin">Prodin: a Swing ERP on the web<a href="https://docs.webforj.com/blog/who-uses-webforj#prodin" class="hash-link" aria-label="Direct link to Prodin: a Swing ERP on the web" title="Direct link to Prodin: a Swing ERP on the web" translate="no">​</a></h2>
<p>Prodin Business Solutions is a Dutch ERP software provider with over 45 years of experience. Its ERP system was built on a Java Swing architecture, and the task was to modernize it for a web-first world.</p>
<p>Prodin looked at low-code platforms, and at a Java backend combined with front-end frameworks like Angular and React. It chose webforJ. The reasons include reuse of existing Java-capable code, some of which had been written over two decades ago, and using Java across the whole stack instead of splitting work across technologies and teams.</p>
<p>How the project went:</p>
<ul>
<li class="">Prodin assembled a six-member Java development team, including junior and mid-level developers, to assist in the migration alongside its existing staff.</li>
<li class="">Within four months, Prodin delivered its first web-based modules to customers.</li>
<li class="">The first web modules shipped while reusing the existing Java codebase, which avoided a complete rewrite.</li>
<li class="">Zero deployment was one of the reasons for the choice: updates roll out across the web without requiring end-user intervention.</li>
<li class="">Prodin can now offer both on-premise and SaaS solutions.</li>
</ul>
<p>In Prodin's words: "webforJ enabled us to deliver a fully web-based version of our ERP in just four months, all while reusing our existing Java codebase."</p>
<p>The full story is <a href="https://webforj.com/wp-content/uploads/2024/10/BASIS_SuccessStory_Prodin.pdf" target="_blank" rel="noopener noreferrer" class="">Prodin's Journey to Web Modernization with webforJ</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="bp">The b+p survey project<a href="https://docs.webforj.com/blog/who-uses-webforj#bp" class="hash-link" aria-label="Direct link to The b+p survey project" title="Direct link to The b+p survey project" translate="no">​</a></h2>
<p>b+p Beratung und Personal is an established HR consulting firm in the southwest of Germany, founded in 1998. In fall 2023 it partnered with BASIS International to deliver an employee survey at the University of Saarland. The goal was to gather insights from over 500 employees across mobile and desktop devices within just two weeks.</p>
<p>b+p managed the overall project. BASIS International provided consulting and development capacity, and the custom solution was built with webforJ.</p>
<p>The requirements were:</p>
<ul>
<li class="">Support a large number of respondents across desktop and mobile.</li>
<li class="">Comply with GDPR, with anonymized responses that are accessible only in aggregated form.</li>
<li class="">Scale to handle thousands of concurrent users.</li>
</ul>
<p>Over 500 employees were invited to take part, and the app handled the load with no noticeable performance degradation. Responses were anonymized before delivery to the university.</p>
<p>The full story is <a href="https://webforj.com/wp-content/uploads/2024/10/BASIS_SuccessStory_bp.pdf" target="_blank" rel="noopener noreferrer" class="">Empowering Project Implementation Partners with webforJ for Employee Surveys</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="in-common">What these projects have in common<a href="https://docs.webforj.com/blog/who-uses-webforj#in-common" class="hash-link" aria-label="Direct link to What these projects have in common" title="Direct link to What these projects have in common" translate="no">​</a></h2>
<p>Both are business apps, and both ran under real constraints. One had an existing codebase to keep, the other a two-week window and a privacy rule.</p>
<p>Prodin is the desktop modernization case. A Swing ERP system with Java logic written over a long period moved to the web without a rewrite, by a Java team. Our guide to <a class="" href="https://docs.webforj.com/blog/swing-to-web-migration">Swing to web migration</a> covers moving screens one at a time.</p>
<p>b+p is the custom app case. A standard survey tool wasn't the fit, so the team built a tailored app in Java that was developed and deployed in one environment.</p>
<p>Both projects show what we built the framework for. webforJ is the full-stack Java framework for business web apps, and you build the whole app, screens included, in Java. For the capabilities behind that, read our guide to the <a class="" href="https://docs.webforj.com/blog/java-full-stack-framework">full-stack Java framework</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="who-is-behind">Who builds and supports webforJ?<a href="https://docs.webforj.com/blog/who-uses-webforj#who-is-behind" class="hash-link" aria-label="Direct link to Who builds and supports webforJ?" title="Direct link to Who builds and supports webforJ?" translate="no">​</a></h2>
<p>webforJ is built by BASIS International. <a href="https://webforj.com/company" target="_blank" rel="noopener noreferrer" class="">BASIS</a> software and software tools have been used to develop business solutions for both large international corporations and SMEs for almost 40 years, with 20+ years of delivering technology built on Java.</p>
<p>Operating its own sites in North America and Europe and working with partners in more than 30 countries, BASIS is well positioned on the international stage.</p>
<p>Support is part of it too. Prodin took part in BASIS International's growth accelerator support program, with regular Q&amp;A sessions and personal access to the core webforJ development team.</p>
<p>For the wider case on releases and maturity, read <a class="" href="https://docs.webforj.com/blog/is-webforj-production-ready">Is webforJ production ready</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/who-uses-webforj#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-companies">Which companies use webforJ in production?<a href="https://docs.webforj.com/blog/who-uses-webforj#faq-companies" class="hash-link" aria-label="Direct link to Which companies use webforJ in production?" title="Direct link to Which companies use webforJ in production?" translate="no">​</a></h3>
<p>Prodin Business Solutions, a Dutch software provider for enterprise resource planning, and b+p, an HR consulting firm in Southwest Germany, each have a published webforJ customer story. Prodin delivered its first web-based modules within four months, with a six-member Java development team assisting its existing staff. b+p delivered an employee survey for over 500 employees at the University of Saarland.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-stories">Where are the webforJ customer stories?<a href="https://docs.webforj.com/blog/who-uses-webforj#faq-stories" class="hash-link" aria-label="Direct link to Where are the webforJ customer stories?" title="Direct link to Where are the webforJ customer stories?" translate="no">​</a></h3>
<p>On the <a href="https://webforj.com/success-stories/" target="_blank" rel="noopener noreferrer" class="">success stories page</a> on our website, under the "Our webforJ Success Stories" heading. Each story is a PDF you can read in full.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-apps">What kinds of apps are built with webforJ?<a href="https://docs.webforj.com/blog/who-uses-webforj#faq-apps" class="hash-link" aria-label="Direct link to What kinds of apps are built with webforJ?" title="Direct link to What kinds of apps are built with webforJ?" translate="no">​</a></h3>
<p>The published stories are business applications: an ERP system moved from Swing to the web, and a custom employee survey with anonymized responses. Both were built in Java.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-behind">Who is behind webforJ?<a href="https://docs.webforj.com/blog/who-uses-webforj#faq-behind" class="hash-link" aria-label="Direct link to Who is behind webforJ?" title="Direct link to Who is behind webforJ?" translate="no">​</a></h3>
<p>BASIS International. BASIS software and software tools have been used to develop business solutions for both large international corporations and SMEs for almost 40 years, with 20+ years of delivering technology built on Java.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="start">Read the stories, then start a project<a href="https://docs.webforj.com/blog/who-uses-webforj#start" class="hash-link" aria-label="Direct link to Read the stories, then start a project" title="Direct link to Read the stories, then start a project" translate="no">​</a></h2>
<p>Open the <a href="https://webforj.com/success-stories/" target="_blank" rel="noopener noreferrer" class="">success stories page</a> and read the Prodin and b+p stories in full. If your own situation looks like one of them, generate a project with <a href="https://docs.webforj.com/startforj" target="_blank" rel="noopener noreferrer" class="">startforJ</a>, follow the <a class="" href="https://docs.webforj.com/docs/introduction/getting-started">getting started guide</a>, and build one real screen of your app in Java.</p><div></div>]]></content:encoded>
            <category>Insights</category>
            <category>Web Development</category>
        </item>
        <item>
            <title><![CDATA[Cursor Spring Boot UI: Let the Assistant Write Your Screens in Java]]></title>
            <link>https://docs.webforj.com/blog/cursor-spring-boot-ui</link>
            <guid>https://docs.webforj.com/blog/cursor-spring-boot-ui</guid>
            <pubDate>Mon, 09 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Build a Spring Boot UI with Cursor and webforJ. Install the AI plugin, prompt for a view that injects a Spring bean, and check it with a browserless test.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-09-cursor-spring-boot-ui/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>You have a Spring Boot backend with services that work, and now it needs screens. Asking an AI assistant to write them is tempting, but a plain prompt in Cursor leaves the assistant guessing at your front end. For a Cursor Spring Boot UI that holds up, give the assistant the real webforJ API and let it write the views in Java. The webforJ AI plugin does that, and a short test confirms the result.</p>
<div class="cta_UErl" role="complementary" aria-label="Using AI to build Java apps?"><div class="copy_XH8h"><p class="title_HfaR">Using AI to build Java apps?</p><p class="text_x4Wj">Ask the team about webforJ AI tooling: the MCP server, Agent Skills, and how they keep generated code correct.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a><a class="secondary_GDTR" href="mailto:sales@basis.cloud?subject=AI%20and%20webforJ&amp;body=Hi%20webforJ%20team%2C%0A%0A%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Ask by email</a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-cursor-needs">What Cursor needs for a Spring Boot UI<a href="https://docs.webforj.com/blog/cursor-spring-boot-ui#what-cursor-needs" class="hash-link" aria-label="Direct link to What Cursor needs for a Spring Boot UI" title="Direct link to What Cursor needs for a Spring Boot UI" translate="no">​</a></h2>
<p>An assistant that guesses at a framework invents method names. Two pieces from the <a class="" href="https://docs.webforj.com/docs/ai-tooling">webforJ AI plugin</a> remove the guessing:</p>
<ul>
<li class="">The <a class="" href="https://docs.webforj.com/docs/ai-tooling/mcp">MCP server</a> lets the assistant look things up in the webforJ docs, scaffold projects, and validate design tokens instead of recalling them from memory.</li>
<li class="">The <a class="" href="https://docs.webforj.com/docs/ai-tooling/agent-skills">Agent Skills</a> tell the assistant when to use those tools and in what order. There are skills for building forms, adding servlets, styling apps, and creating components.</li>
</ul>
<p>Your screens are plain Java classes in the same project as your services. There is no second codebase to hand the assistant. If you use Claude Code instead, the same plugin lets you <a class="" href="https://docs.webforj.com/blog/claude-code-java-web-app">build a Java web app with Claude Code</a> end to end.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="cursor-ai-spring-boot">Cursor AI and Spring Boot, step by step<a href="https://docs.webforj.com/blog/cursor-spring-boot-ui#cursor-ai-spring-boot" class="hash-link" aria-label="Direct link to Cursor AI and Spring Boot, step by step" title="Direct link to Cursor AI and Spring Boot, step by step" translate="no">​</a></h2>
<p>Follow these steps.</p>
<ol>
<li class="">
<p><strong>Create a Spring Boot project.</strong> Use <a href="https://docs.webforj.com/startforj" target="_blank" rel="noopener noreferrer" class="">startforJ</a> and choose <strong>Spring Boot</strong> under <strong>Runs on</strong>. Or use the command line with the <code>webforj-spring</code> flavor:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">mvn </span><span class="token parameter variable" style="color:var(--dwc-code-variable)">-B</span><span class="token plain"> archetype:generate </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">\</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token parameter variable" style="color:var(--dwc-code-variable)">-DarchetypeGroupId</span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain">com.webforj </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">\</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token parameter variable" style="color:var(--dwc-code-variable)">-DarchetypeArtifactId</span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain">webforj-archetype-hello-world </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">\</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token parameter variable" style="color:var(--dwc-code-variable)">-DarchetypeVersion</span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain">LATEST </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">\</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token parameter variable" style="color:var(--dwc-code-variable)">-DgroupId</span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain">org.example </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">\</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token parameter variable" style="color:var(--dwc-code-variable)">-DartifactId</span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain">my-app </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">\</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token parameter variable" style="color:var(--dwc-code-variable)">-Dversion</span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token number" style="color:var(--dwc-code-number)">1.0</span><span class="token plain">-SNAPSHOT </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">\</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token parameter variable" style="color:var(--dwc-code-variable)">-Dflavor</span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain">webforj-spring</span><br></div></code></pre></div></div>
</li>
<li class="">
<p><strong>Connect Cursor to webforJ.</strong> Cursor uses manual configuration rather than a marketplace command. The docs point to the <a href="https://github.com/webforj/webforj-ai#clients" target="_blank" rel="noopener noreferrer" class="">per-client install guide</a> for the exact steps, so follow that guide. Cursor is an MCP-over-HTTP client, so the server address is <code>https://mcp.webforj.com/mcp</code>.</p>
</li>
<li class="">
<p><strong>Name webforJ in the prompt.</strong> That's the cue the assistant uses to reach for the plugin instead of general Java knowledge. Ask for verification too:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">Add a webforJ view at /orders. It takes the existing OrderService</span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">through the constructor and shows its summary for the customer name</span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">typed into a text field. Verify the API against the webforJ docs.</span><br></div></code></pre></div></div>
</li>
<li class="">
<p><strong>Review the view it writes.</strong> Look for a <code>@Route</code> class that receives the bean through its constructor. The next section shows the shape.</p>
</li>
<li class="">
<p><strong>Run the app.</strong> The archetype sets a default Maven goal, so this compiles the app and starts it on port 8080:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">mvn</span><br></div></code></pre></div></div>
</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="build-a-spring-boot-ui">Build a Spring Boot UI with Cursor<a href="https://docs.webforj.com/blog/cursor-spring-boot-ui#build-a-spring-boot-ui" class="hash-link" aria-label="Direct link to Build a Spring Boot UI with Cursor" title="Direct link to Build a Spring Boot UI with Cursor" translate="no">​</a></h2>
<p>This is the kind of view the assistant should hand back. A Spring service holds the logic:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">OrderService.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Service</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">OrderService</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">String</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">summary</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">String</span><span class="token plain"> customer</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token keyword" style="color:var(--dwc-code-keyword)">return</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"Open orders for "</span><span class="token plain"> </span><span class="token operator" style="color:var(--dwc-code-operator)">+</span><span class="token plain"> customer </span><span class="token operator" style="color:var(--dwc-code-operator)">+</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">": 3"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>The view is a <code>@Route</code> class. When Spring is on the classpath, webforJ creates the route through Spring, so the constructor receives the bean:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">OrdersView.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Route</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"/orders"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">OrdersView</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">extends</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Composite</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token generics class-name" style="color:var(--dwc-code-class)">Div</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">OrdersView</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">OrderService</span><span class="token plain"> orders</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token plain"> customer </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Customer"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token plain"> summary </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    customer</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">onModify</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">e </span><span class="token operator" style="color:var(--dwc-code-operator)">-&gt;</span><span class="token plain"> summary</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">orders</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">summary</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">customer</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getValue</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token function" style="color:var(--dwc-code-function)">getBoundComponent</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">customer</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> summary</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>The route class needs no Spring annotation. The <code>@Route</code> annotation alone enables both route discovery and constructor injection. See <a class="" href="https://docs.webforj.com/docs/integrations/spring/routing">Spring routing</a> for how webforJ creates a fresh instance on each navigation.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="check-with-a-test">Check the result with a test<a href="https://docs.webforj.com/blog/cursor-spring-boot-ui#check-with-a-test" class="hash-link" aria-label="Direct link to Check the result with a test" title="Direct link to Check the result with a test" translate="no">​</a></h2>
<p>A generated view that compiles can still do the wrong thing. TestBed runs views in a plain JUnit test with no browser. In a Spring Boot app, <code>@SpringBootTest</code> starts the context and <code>@WebforjTest</code> registers the view. TestBed needs webforJ 26.03, and the Spring pieces are in the <a class="" href="https://docs.webforj.com/docs/integrations/spring/testing">Spring testing guide</a>.</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">OrdersViewTest.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@SpringBootTest</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@WebforjTest</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">routeClasses </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">OrdersView</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">OrdersViewTest</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Autowired</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">OrderService</span><span class="token plain"> orders</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Test</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">shouldShowTheSummaryFromTheService</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">WebforjTestbed</span><span class="token plain"> context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">navigate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">OrdersView</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">UserInteraction</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">type</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">        </span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">byLabel</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Customer"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"Ada"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token function" style="color:var(--dwc-code-function)">verifyThat</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">        </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">hasText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">orders</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">summary</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Ada"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>Ask the assistant to write this test with the view, then run <code>mvn test</code>. If it fails, paste the failure back into the chat. This write, test, fix loop is the one described in <a class="" href="https://docs.webforj.com/blog/ai-verification-loop-java">the AI verification loop</a>. For more on tests without a browser, read <a class="" href="https://docs.webforj.com/blog/java-ui-testing-without-browser">Java UI testing without a browser</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="prompts-that-work">Prompts that work in Cursor<a href="https://docs.webforj.com/blog/cursor-spring-boot-ui#prompts-that-work" class="hash-link" aria-label="Direct link to Prompts that work in Cursor" title="Direct link to Prompts that work in Cursor" translate="no">​</a></h2>
<p>The <a class="" href="https://docs.webforj.com/docs/ai-tooling/mcp">MCP server docs</a> give a few habits worth keeping:</p>
<ul>
<li class="">Mention <strong>webforJ</strong> in every prompt.</li>
<li class="">Be specific. A named project and archetype beat a vague request like make an app.</li>
<li class="">Ask for verification, such as verify against webforJ docs.</li>
<li class="">If the assistant answers without consulting the server, say use the webforJ MCP server to answer.</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/cursor-spring-boot-ui#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-cursor">Does the webforJ AI plugin work with Cursor?<a href="https://docs.webforj.com/blog/cursor-spring-boot-ui#faq-cursor" class="hash-link" aria-label="Direct link to Does the webforJ AI plugin work with Cursor?" title="Direct link to Does the webforJ AI plugin work with Cursor?" translate="no">​</a></h3>
<p>Yes. Cursor is one of the clients that support the plugin and the Agent Skills. Cursor uses manual configuration, and the exact steps are in the <a href="https://github.com/webforj/webforj-ai#clients" target="_blank" rel="noopener noreferrer" class="">per-client install guide</a>.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-no-javascript">Can Cursor build a Java web app without JavaScript?<a href="https://docs.webforj.com/blog/cursor-spring-boot-ui#faq-no-javascript" class="hash-link" aria-label="Direct link to Can Cursor build a Java web app without JavaScript?" title="Direct link to Can Cursor build a Java web app without JavaScript?" translate="no">​</a></h3>
<p>Yes. The views are Java classes, so the assistant writes them in the same language as your services and you review them the same way.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-spring-services">Can I use my existing Spring services?<a href="https://docs.webforj.com/blog/cursor-spring-boot-ui#faq-spring-services" class="hash-link" aria-label="Direct link to Can I use my existing Spring services?" title="Direct link to Can I use my existing Spring services?" translate="no">​</a></h3>
<p>Yes. Any bean in the Spring context can be a constructor parameter of a <code>@Route</code> class, including services and Spring Data repositories.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ship-one-view">Ship one view with a passing test<a href="https://docs.webforj.com/blog/cursor-spring-boot-ui#ship-one-view" class="hash-link" aria-label="Direct link to Ship one view with a passing test" title="Direct link to Ship one view with a passing test" translate="no">​</a></h2>
<ul>
<li class="">Project created with the <code>webforj-spring</code> flavor or startforJ with <strong>Spring Boot</strong>.</li>
<li class="">Cursor configured with the steps from the per-client install guide.</li>
<li class="">"webforJ" named in the prompt, with a request to verify against the docs.</li>
<li class="">View is a <code>@Route</code> class and takes Spring beans in its constructor.</li>
<li class="">Test added with <code>@SpringBootTest</code> and <code>@WebforjTest</code>, and <code>mvn test</code> passes.</li>
<li class="">Generated code read by a person before it ships.</li>
</ul><div></div>]]></content:encoded>
            <category>AI</category>
            <category>Spring</category>
            <category>MCP</category>
        </item>
        <item>
            <title><![CDATA[The webforJ ecosystem: what a Java framework needs in the AI era]]></title>
            <link>https://docs.webforj.com/blog/webforj-ecosystem</link>
            <guid>https://docs.webforj.com/blog/webforj-ecosystem</guid>
            <pubDate>Mon, 09 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How big is the webforJ ecosystem? Built-in components from one team, any web component or npm package, the Java ecosystem, and AI assistants that write current webforJ code.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-09-webforj-ecosystem/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>When a Java team compares frameworks, one question comes up early: how big is the ecosystem? It used to be a fair proxy for safety. More add-ons, more examples and more forum answers meant less code to write yourself and fewer dead ends.</p>
<p>The webforJ ecosystem answers that question differently, because the work has changed. Your team now writes much of its code with an AI assistant, so what counts is whether the parts you need are maintained for the version you run, and whether your assistant writes current, correct code for it.</p>
<div class="cta_UErl" role="complementary" aria-label="Already running Spring Boot?"><div class="copy_XH8h"><p class="title_HfaR">Already running Spring Boot?</p><p class="text_x4Wj">Ask the team how webforJ fits into your existing Spring app.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a><a class="secondary_GDTR" href="mailto:sales@basis.cloud?subject=webforJ%20with%20Spring%20Boot&amp;body=Hi%20webforJ%20team%2C%0A%0A%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Ask by email</a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="maintained">Count what's maintained<a href="https://docs.webforj.com/blog/webforj-ecosystem#maintained" class="hash-link" aria-label="Direct link to Count what's maintained" title="Direct link to Count what's maintained" translate="no">​</a></h2>
<p>A long list of third-party add-ons looks good on a comparison chart. In practice, a list like that ages. Add-ons are built by volunteers for one major version, the author moves on, and the entry stays. The list keeps growing while the share you can safely put in production shrinks, and every add-on you adopt becomes an upgrade you own.</p>
<p>webforJ takes the other route. The components a business app needs ship in the framework itself, built and released by one team: <a class="" href="https://docs.webforj.com/docs/components/table/overview">tables</a>, <a class="" href="https://docs.webforj.com/docs/components/fields/textfield">forms and fields</a>, <a class="" href="https://docs.webforj.com/docs/components/dialog">dialogs</a>, <a class="" href="https://docs.webforj.com/docs/components/app-layout">layouts</a>, <a class="" href="https://docs.webforj.com/docs/components/tree">trees</a>, <a class="" href="https://docs.webforj.com/docs/components/upload">uploads</a>, <a class="" href="https://docs.webforj.com/docs/components/google-charts">charts</a>, and more. They follow the same release as the framework and come out together in each version on Maven Central. Upgrading the framework upgrades all of them.</p>
<p>Upgrades themselves are automated. The <a class="" href="https://docs.webforj.com/docs/upgrading/automated-upgrades">webforJ OpenRewrite recipes</a> rename APIs, update dependencies and flag the spots that need a person, so moving to a new version is a command, not a project.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="web-components">Every web component is a webforJ component<a href="https://docs.webforj.com/blog/webforj-ecosystem#web-components" class="hash-link" aria-label="Direct link to Every web component is a webforJ component" title="Direct link to Every web component is a webforJ component" translate="no">​</a></h2>
<p>The built-in set is where the ecosystem starts, not where it ends. webforJ's own components are built on web components, so any custom element from the wider web works the same way. With <a class="" href="https://docs.webforj.com/docs/building-ui/element-composite"><code>ElementComposite</code></a> you expose its properties, attributes and events through a typed Java class and use it like any other component.</p>
<p>The <a class="" href="https://docs.webforj.com/docs/managing-resources/bundler/overview">frontend bundler</a> goes further. A class names the npm package it needs, by name and version, and the build installs and compiles it. You can also write a component in React, Svelte or Lit and use it from Java, all without a Node toolchain to install or run.</p>
<p>That puts the whole npm and web component world behind a Java API. Our guide to <a class="" href="https://docs.webforj.com/blog/web-components-in-java">web components in Java</a> walks through the full pattern.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="java-ecosystem">The Java ecosystem is yours<a href="https://docs.webforj.com/blog/webforj-ecosystem#java-ecosystem" class="hash-link" aria-label="Direct link to The Java ecosystem is yours" title="Direct link to The Java ecosystem is yours" translate="no">​</a></h2>
<p>webforJ is a Java framework, so every library on Maven Central is part of its ecosystem. With <a class="" href="https://docs.webforj.com/docs/integrations/spring/spring-boot">Spring Boot</a>, your views inject any Spring bean, tables read from <a class="" href="https://docs.webforj.com/docs/integrations/spring/spring-data-jpa">Spring Data JPA</a> repositories, and routes are protected through <a class="" href="https://docs.webforj.com/docs/security/overview">route security</a> with Spring Security. Long-running work runs as <a class="" href="https://docs.webforj.com/docs/integrations/spring/background-jobs">background jobs</a> that update the UI when they finish.</p>
<p>Your team keeps the libraries, the build, and the tooling it already trusts. webforJ adds the screens.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ai-fluency">Can your AI assistant speak webforJ?<a href="https://docs.webforj.com/blog/webforj-ecosystem#ai-fluency" class="hash-link" aria-label="Direct link to Can your AI assistant speak webforJ?" title="Direct link to Can your AI assistant speak webforJ?" translate="no">​</a></h2>
<p>In the AI era, the size of an ecosystem is measured less in add-ons and more in how well an assistant writes code for it. The amount of old example code on the internet doesn't settle that. An assistant trained on years of posts mixes versions, and the more outdated code there is, the more often it suggests an API that's gone.</p>
<p>What makes an assistant fluent is current, version-aware knowledge and a way to check its work. webforJ ships both, in one install of the <a class="" href="https://docs.webforj.com/docs/ai-tooling">webforJ AI plugin</a> for Claude Code, Copilot, Cursor, Gemini, and Codex.</p>
<ul>
<li class=""><strong>The MCP server</strong> gives the assistant live access to the webforJ knowledge base. It reads your <code>pom.xml</code>, resolves the webforJ version you're on and scopes every answer to it. It also validates design tokens before they land in your CSS. See <a class="" href="https://docs.webforj.com/docs/ai-tooling/mcp">the MCP server</a>.</li>
<li class=""><strong>Agent Skills</strong> teach the assistant the webforJ way to do a task, from forms with binding and validation to route security, translation, timers and async work, styling, servlets, custom components and version upgrades. See <a class="" href="https://docs.webforj.com/docs/ai-tooling/agent-skills">Agent Skills</a>.</li>
<li class=""><strong>Browserless tests</strong> let the assistant run a view in a plain JUnit test with the <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a> and get a clear pass or fail.</li>
<li class=""><strong>The craftforJ Assistant</strong> works inside your running app. It writes Java, compiles each edit before you see it and applies it. See <a class="" href="https://docs.webforj.com/docs/ai-tooling/craftforj-assistant">the craftforJ Assistant</a>.</li>
</ul>
<p>So the assistant doesn't rely on what it happened to read during training. It looks up the API for your version, follows the workflow, and checks the result. We cover that loop in <a class="" href="https://docs.webforj.com/blog/ai-verification-loop-java">the AI verification loop for Java</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="checklist">What to ask of any ecosystem<a href="https://docs.webforj.com/blog/webforj-ecosystem#checklist" class="hash-link" aria-label="Direct link to What to ask of any ecosystem" title="Direct link to What to ask of any ecosystem" translate="no">​</a></h2>
<p>When you weigh a framework for your next business app, these questions say more than the length of an add-on list:</p>
<ol>
<li class="">Are the components you need maintained by the same team that ships the framework?</li>
<li class="">Can you use any web component or npm package without waiting for someone to wrap it?</li>
<li class="">Does it work with the Java libraries and Spring stack you already run?</li>
<li class="">Are upgrades automated?</li>
<li class="">Does your AI assistant get version-correct answers and a way to test its own code?</li>
</ol>
<p>webforJ answers yes to all five. For the full picture of what the framework covers, read our guide to the <a class="" href="https://docs.webforj.com/blog/java-full-stack-framework">full-stack Java framework</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/webforj-ecosystem#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-big-enough">Is the webforJ ecosystem big enough for business apps?<a href="https://docs.webforj.com/blog/webforj-ecosystem#faq-big-enough" class="hash-link" aria-label="Direct link to Is the webforJ ecosystem big enough for business apps?" title="Direct link to Is the webforJ ecosystem big enough for business apps?" translate="no">​</a></h3>
<p>Yes. The components business apps need ship in the framework, and one team maintains and releases them. Any web component or npm package connects through a typed Java class, and the whole Java ecosystem, Spring included, is available.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-ai-know">Do AI assistants know webforJ?<a href="https://docs.webforj.com/blog/webforj-ecosystem#faq-ai-know" class="hash-link" aria-label="Direct link to Do AI assistants know webforJ?" title="Direct link to Do AI assistants know webforJ?" translate="no">​</a></h3>
<p>With the webforJ AI plugin, yes. The MCP server gives the assistant live, version-scoped access to the webforJ knowledge base, Agent Skills teach it the workflows, and the TestBed lets it test what it wrote.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-missing-component">What if I need a component webforJ doesn't have?<a href="https://docs.webforj.com/blog/webforj-ecosystem#faq-missing-component" class="hash-link" aria-label="Direct link to What if I need a component webforJ doesn't have?" title="Direct link to What if I need a component webforJ doesn't have?" translate="no">​</a></h3>
<p>Wrap an existing web component with <code>ElementComposite</code>, or pull in an npm package or a React, Svelte or Lit component through the frontend bundler. The webforJ AI plugin includes a skill for exactly this task.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="start">Build your first screen with AI<a href="https://docs.webforj.com/blog/webforj-ecosystem#start" class="hash-link" aria-label="Direct link to Build your first screen with AI" title="Direct link to Build your first screen with AI" translate="no">​</a></h2>
<p>Install the <a class="" href="https://docs.webforj.com/docs/ai-tooling">webforJ AI plugin</a>, generate a project with <a href="https://docs.webforj.com/startforj" target="_blank" rel="noopener noreferrer" class="">startforJ</a>, and ask your assistant to build one real screen of your app. Then run its test.</p><div></div>]]></content:encoded>
            <category>Insights</category>
            <category>Spring</category>
            <category>JavaScript</category>
        </item>
        <item>
            <title><![CDATA[Modernize a Java Swing app without JavaScript: JavaOne 2026]]></title>
            <link>https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk</link>
            <guid>https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk</guid>
            <pubDate>Sun, 08 Nov 2026 12:00:00 GMT</pubDate>
            <description><![CDATA[Watch how to modernize a Java Swing app without JavaScript: run it in the browser with Webswing, then build new screens in Java with webforJ, step by step.]]></description>
            <content:encoded><![CDATA[
<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-08-modernize-java-ui-without-javascript-talk/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>Your Swing app works, your users know it, and the request on the table is to make it run in a browser. The usual answer is a rewrite with a JavaScript framework, a new API layer, and a second team. At JavaOne 2026, Stephan Wald, our Head of Development at BASIS International, showed how to modernize a Java Swing app without JavaScript instead: put the existing app in the browser first, then build everything that comes next in Java with webforJ, the full-stack Java framework.</p>
<div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;margin-bottom:1.5rem"><iframe src="https://www.youtube.com/embed/P2W54sxjqgY" title="Modernizing Java UIs Without JavaScript: Escape the Multi-Stack Trap" style="position:absolute;top:0;left:0;width:100%;height:100%;border:0" allowfullscreen=""></iframe></div>
<div class="cta_UErl" role="complementary" aria-label="Moving a desktop Java app to the web?"><div class="copy_XH8h"><p class="title_HfaR">Moving a desktop Java app to the web?</p><p class="text_x4Wj">Send us a screenshot of one screen and we'll reply with how it moves to webforJ.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="mailto:sales@basis.cloud?subject=My%20app%20screen%3A%20how%20would%20it%20move%20to%20webforJ%3F&amp;body=Hi%20webforJ%20team%2C%0A%0AAttached%20is%20a%20screenshot%20of%20one%20screen%20from%20our%20app.%20It%20is%20built%20with%3A%20(Swing%2C%20JavaFX%2C%20other)%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Send a screenshot</a><a class="secondary_GDTR" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-the-talk-covers">What the talk covers<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#what-the-talk-covers" class="hash-link" aria-label="Direct link to What the talk covers" title="Direct link to What the talk covers" translate="no">​</a></h2>
<ul>
<li class=""><strong><a href="https://www.youtube.com/watch?v=P2W54sxjqgY&amp;t=0s" target="_blank" rel="noopener noreferrer" class="">00:00</a></strong> Why business apps move to the browser</li>
<li class=""><strong><a href="https://www.youtube.com/watch?v=P2W54sxjqgY&amp;t=113s" target="_blank" rel="noopener noreferrer" class="">01:53</a></strong> The multi-stack trap: an API layer plus a JavaScript rewrite</li>
<li class=""><strong><a href="https://www.youtube.com/watch?v=P2W54sxjqgY&amp;t=259s" target="_blank" rel="noopener noreferrer" class="">04:19</a></strong> Why big rewrites stall</li>
<li class=""><strong><a href="https://www.youtube.com/watch?v=P2W54sxjqgY&amp;t=486s" target="_blank" rel="noopener noreferrer" class="">08:06</a></strong> Keep both sides in Java</li>
<li class=""><strong><a href="https://www.youtube.com/watch?v=P2W54sxjqgY&amp;t=630s" target="_blank" rel="noopener noreferrer" class="">10:30</a></strong> Step one: run the Swing app in the browser with Webswing</li>
<li class=""><strong><a href="https://www.youtube.com/watch?v=P2W54sxjqgY&amp;t=1031s" target="_blank" rel="noopener noreferrer" class="">17:11</a></strong> Step two: the Webswing connector in webforJ</li>
<li class=""><strong><a href="https://www.youtube.com/watch?v=P2W54sxjqgY&amp;t=1240s" target="_blank" rel="noopener noreferrer" class="">20:40</a></strong> What webforJ is, and how it maps to Swing</li>
<li class=""><strong><a href="https://www.youtube.com/watch?v=P2W54sxjqgY&amp;t=1699s" target="_blank" rel="noopener noreferrer" class="">28:19</a></strong> A customer example</li>
<li class=""><strong><a href="https://www.youtube.com/watch?v=P2W54sxjqgY&amp;t=2046s" target="_blank" rel="noopener noreferrer" class="">34:06</a></strong> Start a webforJ app from scratch, live</li>
<li class=""><strong><a href="https://www.youtube.com/watch?v=P2W54sxjqgY&amp;t=2233s" target="_blank" rel="noopener noreferrer" class="">37:13</a></strong> Questions from the audience</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-the-browser">Why the browser, and why now<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#why-the-browser" class="hash-link" aria-label="Direct link to Why the browser, and why now" title="Direct link to Why the browser, and why now" translate="no">​</a></h2>
<p>The talk opens with a show of hands. Hands go up for Swing, someone in the room runs Jakarta Faces, and every one of those teams hears the same request. The app should run in a browser.</p>
<p>Part of that is expectation, because the browser is where users do everything else. Part of it is cost. A desktop client needs a Java runtime on every machine, and many companies add remote desktop servers or terminal services on top so people can reach the app from anywhere. Each of those layers adds cost, infrastructure, and administration. A browser app removes the client install entirely.</p>
<p>The point Stephan makes early is worth keeping in mind for the whole talk: users do not dislike the app because it is Java. They dislike reaching it through a desktop client in a world that runs in a browser. The problem is the delivery, not the code.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-multi-stack-trap">The multi-stack trap<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#the-multi-stack-trap" class="hash-link" aria-label="Direct link to The multi-stack trap" title="Direct link to The multi-stack trap" translate="no">​</a></h2>
<p>The reflex is to treat the browser as a reason to switch languages. The business logic gets wrapped in REST endpoints it was never designed for, the screens get rewritten in JavaScript, and the company now hires and coordinates two teams.</p>
<p>A well-built Swing app often has a clean split between model and view already. That split still does not map onto a REST contract, because an API has to draw its lines in different places. So a team with battle-tested logic ends up rewriting large parts of it just to make it reachable from a JavaScript front end. In Stephan's words, rewriting is the wrong default.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-rewrites-stall">Why big rewrites stall<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#why-rewrites-stall" class="hash-link" aria-label="Direct link to Why big rewrites stall" title="Direct link to Why big rewrites stall" translate="no">​</a></h2>
<p>The talk names the pattern most teams recognize:</p>
<ul>
<li class=""><strong>The second-version problem.</strong> A rewrite becomes the chance to add everything that was never built, and the scope keeps growing until the project never ends.</li>
<li class=""><strong>Knowledge walks out the door.</strong> The people who wrote the original logic leave over time, and the rules buried in that code get harder to recover with every month the rewrite runs.</li>
<li class=""><strong>Two stacks to staff.</strong> Front-end and back-end specialists each own half of every feature, and every change crosses a contract between them.</li>
</ul>
<p>The alternative is simple. Keep both sides in Java, and let the framework handle the browser.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-one-webswing">Step one: the app in the browser<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#step-one-webswing" class="hash-link" aria-label="Direct link to Step one: the app in the browser" title="Direct link to Step one: the app in the browser" translate="no">​</a></h2>
<p><a class="" href="https://docs.webforj.com/docs/integrations/webswing/overview">Webswing</a> runs a Java desktop app (Swing, JavaFX, or SWT) in a web browser without changes to its source code. It renders the app on the server and streams the interface to the browser, so users reach the same screens through a URL instead of an installed client or a remote desktop session.</p>
<p>The live demo makes the point quickly. Stephan configures a stock Swing app in the Webswing admin console and opens it in the browser. It runs with its familiar look and responds quickly. He then opens an Eclipse RCP demo the same way, with configuration only.</p>
<p>That is the fastest answer to the browser request. Configure the app, deploy it, and your users open it in a browser. It also buys the time to modernize properly instead of under pressure.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-two-webforj">Step two: new screens in webforJ<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#step-two-webforj" class="hash-link" aria-label="Direct link to Step two: new screens in webforJ" title="Direct link to Step two: new screens in webforJ" translate="no">​</a></h2>
<p>Webswing keeps the existing UI as it is, including its fixed desktop layouts. The real modernization starts when new work moves to webforJ, and it can start right away. The <a class="" href="https://docs.webforj.com/docs/integrations/webswing/setup">Webswing connector</a> embeds the Webswing-hosted app inside a webforJ view, so old and new screens live in one modern UI:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Route</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"/"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">CustomerTableView</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">extends</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Composite</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token generics class-name" style="color:var(--dwc-code-class)">FlexLayout</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">final</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">FlexLayout</span><span class="token plain"> self </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">getBoundComponent</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">CustomerTableView</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Value</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"${webswing.connector.url}"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">String</span><span class="token plain"> webswingUrl</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">WebswingConnector</span><span class="token plain"> connector </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">WebswingConnector</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">webswingUrl</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    connector</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setSize</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"100vw"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"100vh"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    self</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">connector</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>The connector also opens a channel between the two sides, so the Swing app and the webforJ view can exchange events. The <a class="" href="https://docs.webforj.com/docs/integrations/webswing/tutorial">Webswing tutorial</a> builds a full example, and the <a class="" href="https://docs.webforj.com/docs/integrations/webswing/communication">communication guide</a> covers events in both directions. From there you replace modules one at a time, starting wherever the business needs change first, while every new initiative is built in webforJ from day one.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-it-feels-familiar">Why webforJ feels familiar<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#why-it-feels-familiar" class="hash-link" aria-label="Direct link to Why webforJ feels familiar" title="Direct link to Why webforJ feels familiar" translate="no">​</a></h2>
<p>This is where webforJ makes the case for itself. For a Swing developer, the move is short. A <code>JButton</code> with an action listener becomes a webforJ <code>Button</code> with a click listener:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token plain"> save </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Save"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">save</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">onClick</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">event </span><span class="token operator" style="color:var(--dwc-code-operator)">-&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token comment" style="color:var(--dwc-code-comment);font-style:italic">// Handle the click</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><br></div></code></pre></div></div>
<p>The code runs on the server, where your business logic already lives. The browser renders the components through a thin client and sends events back to your Java listeners. That listener can call a Spring service or any plain Java class, because a webforJ app is a Java program.</p>
<p>Two things follow that are much harder to get with a separate JavaScript front end. First, debugging stays in one place: set a breakpoint in the listener, click the button in the browser, and your IDE stops on the line, with every variable in reach (<a class="" href="https://docs.webforj.com/docs/configuration/debugging">debugging</a>). Second, the screen needs no CSS or JavaScript to work at all. The Java code is the whole screen.</p>
<p>What changes is the layout, and it changes for the better. New screens can use responsive layouts, drawers, dialogs, and accordions that a fixed Swing window never had. And because webforJ integrates with Spring Boot and ships its own AI tooling, the new code joins the modern Java ecosystem instead of a parallel one.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="customer-example">A customer example<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#customer-example" class="hash-link" aria-label="Direct link to A customer example" title="Direct link to A customer example" translate="no">​</a></h2>
<p>The talk also shows Prodin, one of our customers, which moved its Swing-based ERP to the web with webforJ and reused its existing Java code. The published <a href="https://webforj.com/wp-content/uploads/2024/10/BASIS_SuccessStory_Prodin.pdf" target="_blank" rel="noopener noreferrer" class="">success story</a> has the details. Prodin assembled a six-member Java development team, including junior and mid-level developers, to assist in the migration. Within four months, Prodin delivered their first web-based modules to customers.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="one-stack">One stack for the long run<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#one-stack" class="hash-link" aria-label="Direct link to One stack for the long run" title="Direct link to One stack for the long run" translate="no">​</a></h2>
<p>The closing argument is about the next ten years, not the next release. Every framework a team adds is one more thing to maintain long after the people who chose it have moved on.</p>
<p>A single Java stack is the answer webforJ gives. The language, the debugger, the build, the tests, and the people stay the same from the database to the browser. That is what helps a business app stay maintainable at scale. Another talk builds <a class="" href="https://docs.webforj.com/blog/java-installable-web-app-talk">an installable Java web app in 15 minutes</a>, all in Java.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="monday-morning-plan">A plan for next week<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#monday-morning-plan" class="hash-link" aria-label="Direct link to A plan for next week" title="Direct link to A plan for next week" translate="no">​</a></h2>
<p>The talk ends with a plan you can start next week:</p>
<ol>
<li class="">Pick your most urgent legacy app and run it in the browser with Webswing on your machine.</li>
<li class="">Create a webforJ project. It takes about a minute with <a href="https://docs.webforj.com/startforj" target="_blank" rel="noopener noreferrer" class="">startforJ</a> or a <a class="" href="https://docs.webforj.com/docs/building-ui/archetypes/overview">webforJ archetype</a>.</li>
<li class="">Follow the <a class="" href="https://docs.webforj.com/docs/integrations/webswing/tutorial">Webswing tutorial</a> to connect the old app and a webforJ view, and try it out.</li>
</ol>
<p>From there, build the next new screen in webforJ instead of in Swing.</p>
<p>The live coding at the end does exactly step two. Stephan creates a project from the SideMenu archetype in his IDE, runs it on Jetty, and opens a working multi-view app in the browser, all in plain Java. A webinar covers how to <a class="" href="https://docs.webforj.com/blog/move-java-app-to-web-and-mobile">move a Java app to the web and mobile</a> with the same Webswing-first path.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="written-roadmap">Read the written roadmap<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#written-roadmap" class="hash-link" aria-label="Direct link to Read the written roadmap" title="Direct link to Read the written roadmap" translate="no">​</a></h2>
<p>If you prefer reading, <a class="" href="https://docs.webforj.com/blog/webswing-and-webforj">Webswing and webforJ: a modernization roadmap</a> covers the same path in writing, with the setup details for each step.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-without-javascript">Can I modernize a Java Swing app without JavaScript?<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#faq-without-javascript" class="hash-link" aria-label="Direct link to Can I modernize a Java Swing app without JavaScript?" title="Direct link to Can I modernize a Java Swing app without JavaScript?" translate="no">​</a></h3>
<p>Yes. Webswing puts the existing Swing app in the browser without source changes, and webforJ lets you build every new screen in Java. Your team keeps working in one language from the database to the browser.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-rewrite-first">Do I have to rewrite the Swing app first?<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#faq-rewrite-first" class="hash-link" aria-label="Direct link to Do I have to rewrite the Swing app first?" title="Direct link to Do I have to rewrite the Swing app first?" translate="no">​</a></h3>
<p>No. The app runs in the browser through Webswing as it is. You then replace modules with webforJ screens at your own pace, while the Webswing connector keeps old and new screens in one UI.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-rcp-javafx">Does it work for other desktop toolkits?<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#faq-rcp-javafx" class="hash-link" aria-label="Direct link to Does it work for other desktop toolkits?" title="Direct link to Does it work for other desktop toolkits?" translate="no">​</a></h3>
<p>Webswing supports Swing, JavaFX, and SWT apps, and the talk shows an Eclipse RCP demo running in the browser. RCP apps that rely heavily on OSGi class loading can need extra configuration, so test yours early.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-where-talk">Where can I see the talk?<a href="https://docs.webforj.com/blog/modernize-java-ui-without-javascript-talk#faq-where-talk" class="hash-link" aria-label="Direct link to Where can I see the talk?" title="Direct link to Where can I see the talk?" translate="no">​</a></h3>
<p>The full talk is embedded at the top of this page, and each timestamp in the list of topics opens the video on YouTube at that moment.</p><div></div>]]></content:encoded>
            <category>Community</category>
            <category>Modernization</category>
            <category>Webswing</category>
        </item>
        <item>
            <title><![CDATA[Java frontend frameworks: five ways to build the UI]]></title>
            <link>https://docs.webforj.com/blog/java-frontend-frameworks</link>
            <guid>https://docs.webforj.com/blog/java-frontend-frameworks</guid>
            <pubDate>Sun, 08 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Compare Java frontend frameworks: Thymeleaf, Jakarta Faces, React or Angular, GWT-style compilers and webforJ, the full-stack Java framework in pure Java.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-08-java-frontend-frameworks/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>You have a Java backend, a business app to ship, and a browser to put it in. Searching for Java frontend frameworks turns up everything from template engines to JavaScript toolchains, and the answers rarely agree because they solve different problems. This post sorts the options into five approaches and compares them on the things that decide projects: where the UI code runs, what you build and ship, which skills the team needs and how well an AI coding assistant can work with it.</p>
<p>For most Java teams building business apps, the best frontend framework for a Java backend is webforJ, the full-stack Java framework. The whole app, screens included, is Java. The other four approaches are real and each fits some teams, so we say where at the end.</p>
<div class="cta_UErl" role="complementary" aria-label="Working on something similar?"><div class="copy_XH8h"><p class="title_HfaR">Working on something similar?</p><p class="text_x4Wj">Ask the webforJ team. Questions are welcome, big or small.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a><a class="secondary_GDTR" href="mailto:sales@basis.cloud?subject=Question%20about%20webforJ&amp;body=Hi%20webforJ%20team%2C%0A%0A%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Ask by email</a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-five-approaches">The five approaches<a href="https://docs.webforj.com/blog/java-frontend-frameworks#the-five-approaches" class="hash-link" aria-label="Direct link to The five approaches" title="Direct link to The five approaches" translate="no">​</a></h2>
<p>Every Java frontend choice falls into one of these shapes.</p>
<p><strong>Server-rendered templates.</strong> <a href="https://www.thymeleaf.org/" target="_blank" rel="noopener noreferrer" class="">Thymeleaf</a> is a server-side template engine. A Spring MVC controller fills a model and the browser receives a finished page, so interactivity beyond forms and links means adding JavaScript yourself.</p>
<p><strong>Component frameworks from the Java EE line.</strong> <a href="https://jakarta.ee/specifications/faces/" target="_blank" rel="noopener noreferrer" class="">Jakarta Faces</a>, formerly JSF, is the Jakarta EE specification for server-side component UIs, with XHTML views bound to managed beans.</p>
<p><strong>A JavaScript SPA on a Java backend.</strong> You build the UI with React, Angular or Vue as its own project and the Java side serves REST or GraphQL endpoints. It is powerful and popular, and it is a second discipline.</p>
<p><strong>Java compiled to JavaScript.</strong> <a href="https://www.gwtproject.org/" target="_blank" rel="noopener noreferrer" class="">GWT</a> compiles Java source to JavaScript, and tools such as J2CL and <a href="https://teavm.org/" target="_blank" rel="noopener noreferrer" class="">TeaVM</a> take the same idea further for Java code or bytecode. Your UI code is Java in the editor and JavaScript in the browser.</p>
<p><strong>A full-stack Java framework.</strong> The screens are Java classes that run on the server next to your services. The browser renders them as web components and sends events back to your Java handlers. That is webforJ. What sets webforJ apart is what comes after the screen: routing, forms, tables, security, translation, background updates and tests, all in one model.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-they-compare">How they compare<a href="https://docs.webforj.com/blog/java-frontend-frameworks#how-they-compare" class="hash-link" aria-label="Direct link to How they compare" title="Direct link to How they compare" translate="no">​</a></h2>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th></th><th>Templates</th><th>Faces</th><th>JS SPA</th><th>Java to JS</th><th>webforJ</th></tr></thead><tbody><tr><td>UI language</td><td>HTML plus expressions</td><td>XHTML plus beans</td><td>JavaScript or TypeScript</td><td>Java</td><td>Java</td></tr><tr><td>Where UI code runs</td><td>Server renders, browser shows</td><td>Server</td><td>Browser</td><td>Browser, after compiling</td><td>Server</td></tr><tr><td>Build tooling</td><td>Maven or Gradle</td><td>Maven or Gradle</td><td>Maven plus a Node toolchain</td><td>Maven plus a compiler step</td><td>Maven or Gradle</td></tr><tr><td>Backend contract</td><td>Controllers</td><td>Beans</td><td>REST or GraphQL</td><td>Remote calls</td><td>Direct service calls</td></tr><tr><td>Team skills</td><td>Java and HTML</td><td>Java and XHTML</td><td>Java and a frontend stack</td><td>Java, with compiler limits</td><td>Java</td></tr><tr><td>Rich components</td><td>Bring your own</td><td>Component libraries</td><td>Large ecosystem</td><td>Widget toolkit</td><td>Table, dialogs, layouts, forms ready, plus your own components and web components</td></tr><tr><td>AI-agent friendliness</td><td>Good for pages, two languages</td><td>Mixed</td><td>Two codebases to keep in sync</td><td>Java subset supported by the compiler</td><td>Skills, MCP and a compiler loop</td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<p>The rows that decide projects are build tooling, team skills and the backend contract, so those get their own sections.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="second-language">What changes with a second language<a href="https://docs.webforj.com/blog/java-frontend-frameworks#second-language" class="hash-link" aria-label="Direct link to What changes with a second language" title="Direct link to What changes with a second language" translate="no">​</a></h2>
<p>A JavaScript SPA is the most capable option and the most expensive for a Java team. It adds a package manager, a bundler, a test runner, a framework upgrade cycle and an API contract that both sides must keep compatible. Someone has to own all of it. If you already employ frontend specialists, that cost is already paid. If you do not, you are hiring or retraining before the first screen ships.</p>
<p>Template engines keep you in one build but limit you to what server-rendered pages do well. Compilers keep the language but put a translation step between your code and what runs, which means some Java library features and some debugging habits do not carry over.</p>
<p>With webforJ the same developers who write services write screens, in the same project, with the same debugger, and the same tests. You can still reach JavaScript when a specific library calls for it. <a class="" href="https://docs.webforj.com/docs/building-ui/element-composite"><code>ElementComposite</code></a> wraps a web component in a typed Java class and <a class="" href="https://docs.webforj.com/docs/building-ui/execute-javascript"><code>executeJs</code></a> runs script from Java, so JavaScript is a tool you choose rather than a layer you must staff.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-webforj">Why webforJ is the strongest pick<a href="https://docs.webforj.com/blog/java-frontend-frameworks#why-webforj" class="hash-link" aria-label="Direct link to Why webforJ is the strongest pick" title="Direct link to Why webforJ is the strongest pick" translate="no">​</a></h2>
<p>This is the long answer to "which Java frontend framework", and it comes down to three things.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="screen-is-java">The screen is a Java class<a href="https://docs.webforj.com/blog/java-frontend-frameworks#screen-is-java" class="hash-link" aria-label="Direct link to The screen is a Java class" title="Direct link to The screen is a Java class" translate="no">​</a></h3>
<p>A view is a component class bound to a URL. A view looks like this, as covered in <a class="" href="https://docs.webforj.com/docs/routing/defining-routes">defining routes</a>:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Route</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">value </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"dashboard"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">DashboardView</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">extends</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Composite</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token generics class-name" style="color:var(--dwc-code-class)">Div</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token comment" style="color:var(--dwc-code-comment);font-style:italic">// Component logic here</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>Routing, layouts and navigation are part of the framework. You compose the interface from Java components such as <code>Table</code>, <code>FlexLayout</code> and dialogs, and the whole screen is checked by the Java compiler, refactored by your IDE and covered by the same tools as the rest of your code.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="everything-included">Everything after the screen is included<a href="https://docs.webforj.com/blog/java-frontend-frameworks#everything-included" class="hash-link" aria-label="Direct link to Everything after the screen is included" title="Direct link to Everything after the screen is included" translate="no">​</a></h3>
<p>Most Java frontend choices stop at rendering and leave the rest to a stack of libraries. webforJ covers the rest of the app too. <a class="" href="https://docs.webforj.com/docs/data-binding/overview">Data binding</a> connects form fields to a Java model with Jakarta validation. The <a class="" href="https://docs.webforj.com/docs/components/table/overview">Table</a> works with repositories and Spring Data. Route security plugs into Spring Security through annotations. The framework also provides translation, installable apps and <code>Environment.runLater</code> for pushing background updates to the browser. You read these in one set of docs instead of assembling them from separate projects. Our <a class="" href="https://docs.webforj.com/blog/java-full-stack-framework">full-stack framework overview</a> goes through the whole chain.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="no-contract">No contract between screen and data<a href="https://docs.webforj.com/blog/java-frontend-frameworks#no-contract" class="hash-link" aria-label="Direct link to No contract between screen and data" title="Direct link to No contract between screen and data" translate="no">​</a></h3>
<p>In an SPA every piece of data crosses a serialization boundary twice. In webforJ a screen calls your service method and gets a Java object back, because both live in the same JVM. With Spring Boot, services arrive by constructor injection, and the <a class="" href="https://docs.webforj.com/docs/integrations/spring/overview">Spring integration</a> is a starter dependency. The framework also runs standalone when you have no Spring app. Business rules such as pricing and permission checks stay on the server and never reach the browser.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ai-assistants">AI coding assistants and your frontend<a href="https://docs.webforj.com/blog/java-frontend-frameworks#ai-assistants" class="hash-link" aria-label="Direct link to AI coding assistants and your frontend" title="Direct link to AI coding assistants and your frontend" translate="no">​</a></h2>
<p>Assistants write all five approaches. The difference is how much stays in your hands to check afterwards. A SPA split means an assistant changes two codebases and a contract between them, and a mistake in either shows up at runtime. A compiler-based setup works within the Java subset its compiler supports.</p>
<p>webforJ gives the assistant its own tooling. The <a class="" href="https://docs.webforj.com/docs/ai-tooling">AI plugin</a> bundles the <a class="" href="https://docs.webforj.com/docs/ai-tooling/mcp">MCP server</a>, which looks up real classes and methods instead of guessing them, with <a class="" href="https://docs.webforj.com/docs/ai-tooling/agent-skills">Agent Skills</a> that carry webforJ workflows for forms, styling, security, and more. The <a class="" href="https://docs.webforj.com/docs/ai-tooling/craftforj-assistant">craftforJ Assistant</a> sends each edit to a real Java compiler and corrects it against the diagnostics, so the code you review already compiles. Because the screen is plain Java, <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a> can test it in JUnit with no browser. We cover the full loop in <a class="" href="https://docs.webforj.com/blog/java-framework-for-ai-coding">Java framework for AI coding</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="when-another-fits">When another option fits better<a href="https://docs.webforj.com/blog/java-frontend-frameworks#when-another-fits" class="hash-link" aria-label="Direct link to When another option fits better" title="Direct link to When another option fits better" translate="no">​</a></h2>
<p>We want webforJ to win on merit, so here is where it does not.</p>
<ul>
<li class=""><strong>Public, content-heavy sites with strict SEO needs.</strong> Server-rendered templates produce plain HTML pages, which suits marketing sites and documentation. webforJ targets business apps where the user logs in.</li>
<li class=""><strong>A team that already runs React or Angular well.</strong> If frontend specialists are on staff and the product lives or dies by a bespoke browser experience, a SPA is a fair choice. You can still keep the Java services. And it is not all or nothing: the webforJ <a class="" href="https://docs.webforj.com/docs/managing-resources/bundler/overview">frontend bundler</a> lets you write components in React and use them from Java views, and pull UI libraries from npm, with no Node toolchain to install.</li>
<li class=""><strong>An existing Faces app that works.</strong> Rewriting a stable app for its own sake rarely pays. Move new screens when the business asks for them.</li>
<li class=""><strong>Offline-first or heavily client-side apps.</strong> When most logic must run in the browser without a server connection, a JavaScript framework or a compiler approach is the natural tool.</li>
</ul>
<p>For the rest, which is internal tools, admin consoles, customer portals, line-of-business forms and data-heavy screens built by Java developers, one language and one project is hard to beat. A <a class="" href="https://docs.webforj.com/blog/java-front-end-development">decision guide to Java for front end development</a> goes further.</p>
<p>Our neighboring comparisons cover these angles in more depth. The <a class="" href="https://docs.webforj.com/blog/best-java-ui-frameworks">best Java UI framework for business apps</a> post goes through Spring MVC, Faces and SPAs with their own trade-offs, and <a class="" href="https://docs.webforj.com/blog/java-web-frameworks-2026">the best Java web framework by job</a> separates the backend choice from the screen choice. If a compiler approach is what you are weighing, see the <a class="" href="https://docs.webforj.com/blog/java-to-javascript-compiler-alternative">Java to JavaScript compiler alternative</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="build-one-screen">Build one screen in Java<a href="https://docs.webforj.com/blog/java-frontend-frameworks#build-one-screen" class="hash-link" aria-label="Direct link to Build one screen in Java" title="Direct link to Build one screen in Java" translate="no">​</a></h2>
<p>The fastest way to compare is to build one real screen. Generate a project with <a href="https://docs.webforj.com/startforj" target="_blank" rel="noopener noreferrer" class="">startforJ</a>, follow the <a class="" href="https://docs.webforj.com/docs/introduction/getting-started">getting started guide</a>, and rebuild the form or table that is hardest to maintain today. If it feels natural to your team, the next screen will too.</p>
<p>Once you have picked an approach, <a class="" href="https://docs.webforj.com/blog/java-framework-for-web-applications">Java framework for web applications</a> lists what to require from it.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/java-frontend-frameworks#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-best">What is the best frontend framework for a Java backend?<a href="https://docs.webforj.com/blog/java-frontend-frameworks#faq-best" class="hash-link" aria-label="Direct link to What is the best frontend framework for a Java backend?" title="Direct link to What is the best frontend framework for a Java backend?" translate="no">​</a></h3>
<p>For business apps built by Java developers, webforJ is the best fit because the screens, routing, forms, tables and security are all Java in one project that integrates with Spring Boot. A React or Angular SPA fits teams that already have frontend specialists, and Thymeleaf fits server-rendered content pages.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-no-javascript">Are there Java front end tools that need no JavaScript?<a href="https://docs.webforj.com/blog/java-frontend-frameworks#faq-no-javascript" class="hash-link" aria-label="Direct link to Are there Java front end tools that need no JavaScript?" title="Direct link to Are there Java front end tools that need no JavaScript?" translate="no">​</a></h3>
<p>Yes. Thymeleaf and Jakarta Faces keep the pages in Java and XHTML on the server, and webforJ builds the whole interface from Java components. In webforJ you can still call JavaScript through <code>executeJs</code> or wrap a web component with <code>ElementComposite</code> when a project needs it.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-compiler">Is Java to JavaScript compilation still a good way to build web UIs?<a href="https://docs.webforj.com/blog/java-frontend-frameworks#faq-compiler" class="hash-link" aria-label="Direct link to Is Java to JavaScript compilation still a good way to build web UIs?" title="Direct link to Is Java to JavaScript compilation still a good way to build web UIs?" translate="no">​</a></h3>
<p>It works when most of the logic must run in the browser. The cost is a build step between the code you write and the code that runs, plus limits on which Java libraries compile. Teams building server-backed business apps usually avoid that step by keeping the UI code on the server.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-ai">Which Java web UI frameworks work well with AI coding assistants?<a href="https://docs.webforj.com/blog/java-frontend-frameworks#faq-ai" class="hash-link" aria-label="Direct link to Which Java web UI frameworks work well with AI coding assistants?" title="Direct link to Which Java web UI frameworks work well with AI coding assistants?" translate="no">​</a></h3>
<p>Assistants can work with all of them, so the question is how much they can check. webforJ ships an MCP server, Agent Skills and a compiler feedback loop through the craftforJ Assistant, which lets an assistant look up real APIs and see compile errors before you review. Setups split across two languages leave more to verify by hand.</p><div></div>]]></content:encoded>
            <category>Insights</category>
            <category>Full-Stack</category>
            <category>Front End</category>
        </item>
        <item>
            <title><![CDATA[Claude Code Java Web App: Build the Whole Thing, Screens Included]]></title>
            <link>https://docs.webforj.com/blog/claude-code-java-web-app</link>
            <guid>https://docs.webforj.com/blog/claude-code-java-web-app</guid>
            <pubDate>Sat, 07 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Build a Claude Code Java web app end to end. One plugin gives Claude Code the real webforJ API, a scaffolder, and TestBed tests that pass or fail without a browser.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-07-claude-code-java-web-app/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>You ask your coding agent for a Java screen and get back something that looks right. Then you build it. A method does not exist, a constructor takes other arguments, and the button you asked for has never been clicked by anything. The agent is fast. What you lack is a way to know the result is correct before you read every line.</p>
<p>A Claude Code Java web app does not have to work that way. In webforJ, the full-stack Java framework for business web apps, Claude Code builds the whole app, screens included, and the work gets checked on three fronts: the real API, a scaffolded project, and a test that returns pass or fail without a browser.</p>
<div class="cta_UErl" role="complementary" aria-label="Using AI to build Java apps?"><div class="copy_XH8h"><p class="title_HfaR">Using AI to build Java apps?</p><p class="text_x4Wj">Ask the team about webforJ AI tooling: the MCP server, Agent Skills, and how they keep generated code correct.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a><a class="secondary_GDTR" href="mailto:sales@basis.cloud?subject=AI%20and%20webforJ&amp;body=Hi%20webforJ%20team%2C%0A%0A%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Ask by email</a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="where-it-breaks">Where agent-built Java apps break<a href="https://docs.webforj.com/blog/claude-code-java-web-app#where-it-breaks" class="hash-link" aria-label="Direct link to Where agent-built Java apps break" title="Direct link to Where agent-built Java apps break" translate="no">​</a></h2>
<p>When a coding agent has nothing to look things up in, it writes from memory. Memory is a poor source for a framework with releases, and the failures are predictable:</p>
<ul>
<li class="">It calls an API that does not exist, or used to.</li>
<li class="">It follows generic Java habits instead of the conventions of the framework.</li>
<li class="">It produces code that compiles and does nothing useful when a user clicks.</li>
</ul>
<p>Each failure needs its own check. Telling the agent to be careful fixes none of them. webforJ closes each gap with a piece of tooling, and Claude Code can use all of it. The <a class="" href="https://docs.webforj.com/blog/ai-verification-loop-java">verification loop</a> post covers the idea across tools. This post is the Claude Code walkthrough.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="for-java-developers">Claude Code for Java developers<a href="https://docs.webforj.com/blog/claude-code-java-web-app#for-java-developers" class="hash-link" aria-label="Direct link to Claude Code for Java developers" title="Direct link to Claude Code for Java developers" translate="no">​</a></h2>
<p>Claude Code is Anthropic's coding agent that runs in your terminal and works inside your project. For a Java team that matters, because the agent edits the same <code>pom.xml</code> and the same source tree you do.</p>
<p>webforJ gives it three things:</p>
<ol>
<li class=""><strong>The real API.</strong> The <a class="" href="https://docs.webforj.com/docs/ai-tooling/mcp">MCP server</a> searches the webforJ knowledge base, so the agent reads signatures instead of recalling them.</li>
<li class=""><strong>The right workflow.</strong> <a class="" href="https://docs.webforj.com/docs/ai-tooling/agent-skills">Agent Skills</a> tell the agent how to approach forms, security, styling, timers, and more.</li>
<li class=""><strong>A pass or fail.</strong> The <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a> runs a view in a plain JUnit test, so the agent can prove its own work.</li>
</ol>
<p>The first two arrive in one install.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="install">Install the plugin<a href="https://docs.webforj.com/blog/claude-code-java-web-app#install" class="hash-link" aria-label="Direct link to Install the plugin" title="Direct link to Install the plugin" translate="no">​</a></h2>
<p>The webforJ AI plugin bundles the MCP server and the Agent Skills. For Claude Code, run:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">claude plugin marketplace </span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token plain"> webforj/webforj-ai</span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">claude plugin </span><span class="token function" style="color:var(--dwc-code-function)">install</span><span class="token plain"> webforj@webforj-ai</span><br></div></code></pre></div></div>
<p>Then verify inside Claude Code:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">/plugin</span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">/mcp</span><br></div></code></pre></div></div>
<p>The <code>webforj</code> plugin appears under <strong>Installed</strong>, and the server shows up as <code>plugin:webforj:webforj-mcp</code> among the connected servers. The <a class="" href="https://docs.webforj.com/docs/ai-tooling">plugin page</a> lists the steps for other clients.</p>
<p>One habit helps: mention <strong>webforJ</strong> in your prompts. That is the cue that sends the agent to the plugin instead of general Java knowledge.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="build">Build a Java web app with Claude Code<a href="https://docs.webforj.com/blog/claude-code-java-web-app#build" class="hash-link" aria-label="Direct link to Build a Java web app with Claude Code" title="Direct link to Build a Java web app with Claude Code" translate="no">​</a></h2>
<p>Start with the project. The MCP server can scaffold one from the official Maven archetypes, so you ask for it in plain words:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">Scaffold a new webforJ sidemenu project called CustomerPortal.</span><br></div></code></pre></div></div>
<p>The server returns the Maven archetype command, and the agent runs it. The archetypes are <code>hello-world</code>, <code>blank</code>, <code>tabs</code>, and <code>sidemenu</code>, and they come in two flavors: <code>webforj</code> and <code>webforj-spring</code>. You can create the same project yourself with <a href="https://docs.webforj.com/startforj" target="_blank" rel="noopener noreferrer" class="">startforJ</a> or the <a class="" href="https://docs.webforj.com/docs/introduction/getting-started">command line</a>. What changes is that the project exists before the agent writes its first view. It already has the correct dependencies and a ready layout.</p>
<p>From there, you describe screens the way you would to a colleague:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">Add a webforJ greeting view at /greeting. A name field, a Greet button,</span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">and a paragraph that says Hello with the name.</span><br></div></code></pre></div></div>
<p>A view in webforJ is a Java class with a route. Nothing else is needed: no template, no JavaScript, and no REST layer between the screen and your code.</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">GreetingView.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv codeBlockLinesWithNumbering_o6Pm" style="counter-reset:line-count 0"><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Route</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"greeting"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">GreetingView</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">extends</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Composite</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token generics class-name" style="color:var(--dwc-code-class)">Div</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">final</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token plain"> name </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Name"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">final</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token plain"> message </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">final</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token plain"> greet </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">      </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Greet"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">ButtonTheme</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token constant" style="color:var(--dwc-code-number)">PRIMARY</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> e </span><span class="token operator" style="color:var(--dwc-code-operator)">-&gt;</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">greet</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain" style="display:inline-block"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">GreetingView</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">    </span><span class="token function" style="color:var(--dwc-code-function)">getBoundComponent</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">name</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> greet</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> message</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain" style="display:inline-block"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">greet</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">    message</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Hello, "</span><span class="token plain"> </span><span class="token operator" style="color:var(--dwc-code-operator)">+</span><span class="token plain"> name</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getValue</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token operator" style="color:var(--dwc-code-operator)">+</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"!"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span></span><br></div></code></pre></div></div>
<p>That is a complete screen. It is also the kind of code an agent gets right more often when it has looked up <code>Composite</code>, <code>Button</code>, and <code>@Route</code> first.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="check">Give the agent a way to check<a href="https://docs.webforj.com/blog/claude-code-java-web-app#check" class="hash-link" aria-label="Direct link to Give the agent a way to check" title="Direct link to Give the agent a way to check" translate="no">​</a></h2>
<p>Reading the view tells you it looks right. A test tells you it works. The TestBed runs the view inside a JUnit test with no browser and no server, so the agent can run <code>mvn test</code> and read the result. Add the module with test scope:</p>
<div class="language-xml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">pom.xml</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-xml codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token tag" style="color:var(--dwc-code-number)">dependency</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token tag" style="color:var(--dwc-code-number)">groupId</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain">com.webforj</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;/</span><span class="token tag" style="color:var(--dwc-code-number)">groupId</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token tag" style="color:var(--dwc-code-number)">artifactId</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain">webforj-testbed-junit</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;/</span><span class="token tag" style="color:var(--dwc-code-number)">artifactId</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token tag" style="color:var(--dwc-code-number)">scope</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain">test</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;/</span><span class="token tag" style="color:var(--dwc-code-number)">scope</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&lt;/</span><span class="token tag" style="color:var(--dwc-code-number)">dependency</span><span class="token tag punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><br></div></code></pre></div></div>
<p>The version comes from the webforJ BOM. Then ask for the test:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">Write a TestBed test for GreetingView that types a name, clicks Greet,</span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">and checks the paragraph.</span><br></div></code></pre></div></div>
<p>The test follows the steps of a user:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">GreetingViewTest.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv codeBlockLinesWithNumbering_o6Pm" style="counter-reset:line-count 0"><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@WebforjTest</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">GreetingViewTest</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain" style="display:inline-block"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Test</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">shouldGreetTheNameTheUserTyped</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">WebforjTestbed</span><span class="token plain"> context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">    context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">GreetingView</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain" style="display:inline-block"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">    </span><span class="token keyword" style="color:var(--dwc-code-keyword)">var</span><span class="token plain"> name </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">byLabel</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Name"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">    </span><span class="token keyword" style="color:var(--dwc-code-keyword)">var</span><span class="token plain"> greet </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">byText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Greet"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain" style="display:inline-block"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">UserInteraction</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">type</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">name</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"Ada"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">UserInteraction</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">click</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">greet</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain" style="display:inline-block"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">    </span><span class="token function" style="color:var(--dwc-code-function)">verifyThat</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">        </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">hasText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Hello, Ada!"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span></span><br></div><div class="token-line codeLine_lJS_" style="color:var(--dwc-code-text)"><span class="codeLineNumber_Tfdd"></span><span class="codeLineContent_feaV"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span></span><br></div></code></pre></div></div>
<p><code>ComponentLocator</code> finds the field by its label and the button by its text. <code>UserInteraction</code> types and clicks, so the listener of the button really runs. <code>verifyThat</code> checks the text a user would read, and a failure names the component and both values. That last detail matters for an agent. A failure it can read is a failure it can fix.</p>
<p>Now the loop closes. The agent writes the view, writes the test, runs it, and reads a pass or a fail. If it fails, the message says what differed, and the agent edits and runs again. You review a result that already passed instead of a guess. The guides on <a class="" href="https://docs.webforj.com/docs/testing/testbed/finding-components">finding components</a> and <a class="" href="https://docs.webforj.com/docs/testing/testbed/assertions">assertions</a> show how far this goes, and the <a class="" href="https://docs.webforj.com/blog/java-ui-testing-without-browser">TestBed guide</a> covers forms, dialogs, and routes.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="spring-boot">Claude Code Spring Boot UI<a href="https://docs.webforj.com/blog/claude-code-java-web-app#spring-boot" class="hash-link" aria-label="Direct link to Claude Code Spring Boot UI" title="Direct link to Claude Code Spring Boot UI" translate="no">​</a></h2>
<p>If your backend is Spring Boot, nothing about the loop changes. Ask for the <code>webforj-spring</code> flavor when you scaffold, and the screens stay Java classes next to your beans and services. For tests, Spring Boot apps use the <code>webforj-spring-testbed</code> module, which works with <code>@SpringBootTest</code> and <code>@WebforjTest</code>, with injected beans and Spring Security on routes. The details are on the <a class="" href="https://docs.webforj.com/docs/integrations/spring/testing">Spring testing</a> page.</p>
<p>So a Claude Code Spring Boot UI gets the same three checks as a standalone one. Standalone and Spring Boot are both supported, and your data can come from Spring Data or any other source. Using Cursor instead of Claude Code, <a class="" href="https://docs.webforj.com/blog/cursor-spring-boot-ui">building a Spring Boot UI with Cursor</a> follows the same path.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="limits">What the loop still misses<a href="https://docs.webforj.com/blog/claude-code-java-web-app#limits" class="hash-link" aria-label="Direct link to What the loop still misses" title="Direct link to What the loop still misses" translate="no">​</a></h2>
<p>Be clear about the limits before you trust it.</p>
<ul>
<li class=""><strong>AI still makes mistakes.</strong> Even with the plugin, an agent can produce wrong code in complex cases. You review and test what it writes, which is why the test is part of the loop.</li>
<li class=""><strong>A browserless test is not a browser test.</strong> The TestBed checks what the view shows and how it reacts. If you need to see how a page renders in an actual browser, you still want an end-to-end test for that.</li>
<li class=""><strong>A test checks what you ask it to check.</strong> If the prompt does not describe a behavior, nothing asserts it. Describe the behavior you care about.</li>
</ul>
<p>Within those limits, the loop does what it should. The agent works from the real API, follows the framework's conventions, and cannot hand back a screen that fails its own test. The same limits shape <a class="" href="https://docs.webforj.com/blog/vibe-coding-java-web-app">vibe coding without losing control</a> in a Java web app.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="one-screen">Ask for one screen with a test<a href="https://docs.webforj.com/blog/claude-code-java-web-app#one-screen" class="hash-link" aria-label="Direct link to Ask for one screen with a test" title="Direct link to Ask for one screen with a test" translate="no">​</a></h2>
<p>Pick a screen you would otherwise build by hand this week. Install the plugin with the two commands from the install section, scaffold or open a webforJ project, and ask Claude Code for the view and its TestBed test in one prompt. Run <code>mvn test</code> and read the result. The <a class="" href="https://docs.webforj.com/docs/testing/testbed/getting-started">Getting started</a> page covers the dependency and the first test in more detail.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">FAQ<a href="https://docs.webforj.com/blog/claude-code-java-web-app#faq" class="hash-link" aria-label="Direct link to FAQ" title="Direct link to FAQ" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-build">Can Claude Code build a Java web app?<a href="https://docs.webforj.com/blog/claude-code-java-web-app#faq-build" class="hash-link" aria-label="Direct link to Can Claude Code build a Java web app?" title="Direct link to Can Claude Code build a Java web app?" translate="no">​</a></h3>
<p>Yes. With webforJ you describe the app, and Claude Code writes the project, the routes, the views, and the tests in Java. The webforJ AI plugin gives it the MCP server and the Agent Skills so it uses real API signatures.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-install">How do you install webforJ for Claude Code?<a href="https://docs.webforj.com/blog/claude-code-java-web-app#faq-install" class="hash-link" aria-label="Direct link to How do you install webforJ for Claude Code?" title="Direct link to How do you install webforJ for Claude Code?" translate="no">​</a></h3>
<p>Run <code>claude plugin marketplace add webforj/webforj-ai</code>, then <code>claude plugin install webforj@webforj-ai</code>. Check it with <code>/plugin</code> and <code>/mcp</code> inside Claude Code.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-spring">Does it work with Spring Boot?<a href="https://docs.webforj.com/blog/claude-code-java-web-app#faq-spring" class="hash-link" aria-label="Direct link to Does it work with Spring Boot?" title="Direct link to Does it work with Spring Boot?" translate="no">​</a></h3>
<p>Yes. Scaffold the <code>webforj-spring</code> flavor and use the <code>webforj-spring-testbed</code> module for tests. Standalone webforJ works the same way without Spring.</p><div></div>]]></content:encoded>
            <category>AI</category>
            <category>MCP</category>
            <category>Full-Stack</category>
        </item>
        <item>
            <title><![CDATA[Java framework for web applications: what to require]]></title>
            <link>https://docs.webforj.com/blog/java-framework-for-web-applications</link>
            <guid>https://docs.webforj.com/blog/java-framework-for-web-applications</guid>
            <pubDate>Sat, 07 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[A Java framework for web applications needs routing, forms, security, data, testing and upgrades. See how webforJ, the full-stack Java framework, covers each.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-07-java-framework-for-web-applications/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>Most lists of Java web frameworks compare names. The question that decides the project is different: what does the app need on the day it goes to production, and how many separate tools will you stitch together to get it? A Java framework for web applications has to answer that question, and the answer starts with a choice between two architectures.</p>
<p>For a business app, our answer is webforJ, the full-stack Java framework. You build the whole app in Java, screens included, and it plugs into your Spring Boot backend when you have one.</p>
<p>This guide is the pillar guide for the search phrase java framework for web applications. It lists what such a framework must provide, explains the two architectures you can choose from, shows what webforJ ships for each item, and says plainly when a backend framework with a JavaScript frontend is the better fit.</p>
<div class="cta_UErl" role="complementary" aria-label="Already running Spring Boot?"><div class="copy_XH8h"><p class="title_HfaR">Already running Spring Boot?</p><p class="text_x4Wj">Ask the team how webforJ fits into your existing Spring app.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a><a class="secondary_GDTR" href="mailto:sales@basis.cloud?subject=webforJ%20with%20Spring%20Boot&amp;body=Hi%20webforJ%20team%2C%0A%0A%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Ask by email</a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="two-architectures">The two architectures<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#two-architectures" class="hash-link" aria-label="Direct link to The two architectures" title="Direct link to The two architectures" translate="no">​</a></h2>
<p>Every Java web framework falls into one of two shapes.</p>
<p><strong>A backend framework plus a separate frontend.</strong> Spring Boot, Quarkus, Micronaut, Jakarta EE and Javalin handle HTTP, services and data in Java. The browser UI is a second app, usually React or Angular, that talks to the backend over REST or GraphQL. Two languages, two build chains, one API contract to keep in sync.</p>
<p><strong>One full-stack Java framework.</strong> Routing, components, forms, security and data access live in a single Java codebase. The same developer who writes the service writes the screen that uses it. There is no REST layer between them that exists only to feed your own UI.</p>
<p>Our <a class="" href="https://docs.webforj.com/blog/java-web-frameworks-2026">comparison of Java web frameworks by job</a> covers the backend options one by one, and <a class="" href="https://docs.webforj.com/blog/best-java-ui-frameworks">the best Java UI framework for business apps</a> ranks the UI side. This post is about the requirements that cut across both.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="requirements">What the framework must provide<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#requirements" class="hash-link" aria-label="Direct link to What the framework must provide" title="Direct link to What the framework must provide" translate="no">​</a></h2>
<p>Nine capabilities decide whether a framework carries a business app or leaves you assembling one. Here is what each means and how webforJ answers it. The decisions a team settles first on a new app are covered in <a class="" href="https://docs.webforj.com/blog/starting-new-java-project">starting a new Java project</a>.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="req-routing">Routing and navigation<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#req-routing" class="hash-link" aria-label="Direct link to Routing and navigation" title="Direct link to Routing and navigation" translate="no">​</a></h3>
<p>Require URLs that map to screens, deep links that survive a reload and nested layouts. In webforJ a view is a Java class mapped to a path with an annotation. See <a class="" href="https://docs.webforj.com/docs/routing/overview">routing</a> and <a class="" href="https://docs.webforj.com/docs/routing/defining-routes">defining routes</a>.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="req-components">UI components<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#req-components" class="hash-link" aria-label="Direct link to UI components" title="Direct link to UI components" translate="no">​</a></h3>
<p>Require a table, a date picker and an app layout out of the box, or you are shopping for libraries on day two. webforJ ships a <a class="" href="https://docs.webforj.com/docs/components/overview">component library</a> that includes <a class="" href="https://docs.webforj.com/docs/components/app-layout">AppLayout</a>, all composed in Java.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="req-forms">Forms and validation<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#req-forms" class="hash-link" aria-label="Direct link to Forms and validation" title="Direct link to Forms and validation" translate="no">​</a></h3>
<p>Require field binding to a model and validation with a standard. webforJ uses <a class="" href="https://docs.webforj.com/docs/data-binding/overview">data binding</a> with <a class="" href="https://docs.webforj.com/docs/data-binding/validation/jakarta-validation">Jakarta Validation</a>, the same annotations your backend entities already carry.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="req-data">Data access<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#req-data" class="hash-link" aria-label="Direct link to Data access" title="Direct link to Data access" translate="no">​</a></h3>
<p>Require rows to come from a repository, not a hand-written endpoint. webforJ's <a class="" href="https://docs.webforj.com/docs/advanced/repository/overview">repository pattern</a> feeds tables, and the <a class="" href="https://docs.webforj.com/docs/integrations/spring/spring-data-jpa">Spring Data JPA integration</a> connects the repositories you already have.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="req-security">Security<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#req-security" class="hash-link" aria-label="Direct link to Security" title="Direct link to Security" translate="no">​</a></h3>
<p>Require access rules on routes, not only on buttons. webforJ attaches annotations to routes, so a view that a user may not open is never rendered, and it works with Spring Security. Route security is available since 25.10. Start at <a class="" href="https://docs.webforj.com/docs/security/overview">security</a>.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="req-testing">Testing<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#req-testing" class="hash-link" aria-label="Direct link to Testing" title="Direct link to Testing" translate="no">​</a></h3>
<p>Require fast tests that do not need a browser. webforJ's <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a>, available since 26.03, runs browserless JUnit tests against views, and end-to-end tests with Selenium or Playwright remain an option. See <a class="" href="https://docs.webforj.com/docs/testing/overview">testing</a> and <a class="" href="https://docs.webforj.com/blog/java-ui-testing-without-browser">Java UI testing without a browser</a>.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="req-deployment">Deployment<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#req-deployment" class="hash-link" aria-label="Direct link to Deployment" title="Direct link to Deployment" translate="no">​</a></h3>
<p>Require one artifact to ship. A webforJ app is an executable JAR with Spring Boot or a WAR for a servlet container, with no frontend bundle on a second host. The <a class="" href="https://docs.webforj.com/docs/integrations/spring/spring-boot">Spring Boot guide</a> and the <a class="" href="https://docs.webforj.com/docs/configuration/deploy-reload/spring-devtools#production-builds">production builds</a> section cover it.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="req-upgrades">Upgrades<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#req-upgrades" class="hash-link" aria-label="Direct link to Upgrades" title="Direct link to Upgrades" translate="no">​</a></h3>
<p>Require a path for existing code when a major release lands. webforJ publishes <a class="" href="https://docs.webforj.com/docs/upgrading/automated-upgrades">OpenRewrite recipes</a> that rename APIs, change types and update dependencies, and leave a <code>TODO</code> comment where no one-to-one replacement exists.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="req-ai">AI tooling<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#req-ai" class="hash-link" aria-label="Direct link to AI tooling" title="Direct link to AI tooling" translate="no">​</a></h3>
<p>Require an assistant that checks real APIs instead of guessing method names. The webforJ <a class="" href="https://docs.webforj.com/docs/ai-tooling">AI plugin</a> bundles an <a class="" href="https://docs.webforj.com/docs/ai-tooling/mcp">MCP server</a> and <a class="" href="https://docs.webforj.com/docs/ai-tooling/agent-skills">Agent Skills</a>, and the craftforJ Assistant checks every edit against a Java compiler. The full loop is in <a class="" href="https://docs.webforj.com/blog/ai-verification-loop-java">the AI verification loop</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="checklist">The requirements at a glance<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#checklist" class="hash-link" aria-label="Direct link to The requirements at a glance" title="Direct link to The requirements at a glance" translate="no">​</a></h2>
<p>Use this table when you shortlist a framework. The right column is what webforJ provides.</p>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th>Requirement</th><th>What to ask</th><th>webforJ</th></tr></thead><tbody><tr><td>Routing</td><td>URL-to-view mapping, nesting, deep links</td><td>Annotated routes, layouts</td></tr><tr><td>Components</td><td>Table, inputs, dialogs, app layout</td><td>Component library composed in Java</td></tr><tr><td>Forms</td><td>Binding and standard validation</td><td>Data binding, Jakarta Validation</td></tr><tr><td>Data access</td><td>Rows from repositories, not hand-built endpoints</td><td>Repository pattern, Spring Data JPA</td></tr><tr><td>Security</td><td>Rules on routes, Spring Security fit</td><td>Route annotations, Spring Security integration</td></tr><tr><td>Testing</td><td>Fast tests without a browser</td><td>TestBed, Bun frontend tests, Selenium or Playwright</td></tr><tr><td>Deployment</td><td>One artifact to ship</td><td>Executable JAR or WAR</td></tr><tr><td>Upgrades</td><td>A tool for major versions</td><td>OpenRewrite recipes</td></tr><tr><td>AI tooling</td><td>Assistant that checks real APIs</td><td>MCP server, Agent Skills, AI plugin</td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<p>A backend-only framework answers the middle rows well and leaves the first three and the last to the second app you build next to it. That gap is the cost of the split architecture, and <a class="" href="https://docs.webforj.com/blog/cost-separate-frontend-backend-teams">the cost of separate frontend and backend teams</a> is worth reading before you commit to it.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="spring-boot">How it fits with Spring Boot<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#spring-boot" class="hash-link" aria-label="Direct link to How it fits with Spring Boot" title="Direct link to How it fits with Spring Boot" translate="no">​</a></h2>
<p>You do not choose between webforJ and Spring Boot. webforJ integrates with your Spring Boot backend: you generate a Spring Boot project, inject services into views, use Spring Data repositories for tables and Spring Security for routes. It also runs standalone when there is no Spring in the picture. If your team already knows Spring, <a class="" href="https://docs.webforj.com/blog/java-full-stack-framework">our Java full stack framework guide</a> walks through a slice from entity to screen.</p>
<p>The unusual part is what you stop writing. A UI that talks to your own services over REST needs controllers, DTOs and a client, all of which exist only to carry data between two halves of the same app. <a class="" href="https://docs.webforj.com/blog/java-ui-without-rest-api">Your Spring Boot app doesn't need a REST API for the UI</a> explains the reasoning, and you can still expose a REST API for other clients when you need one.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="when-split-wins">When a split stack wins<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#when-split-wins" class="hash-link" aria-label="Direct link to When a split stack wins" title="Direct link to When a split stack wins" translate="no">​</a></h2>
<p>A separate JavaScript frontend is the better choice in a few situations, and we would rather say so than pretend otherwise.</p>
<ul>
<li class="">Several independent clients, such as a public website, a mobile app and partner integrations, all need the same API from the first day.</li>
<li class="">You have a frontend team that already ships a JavaScript app and wants to keep its tools.</li>
<li class="">The product is a consumer-facing site whose design is the product, with heavy custom animation and marketing pages.</li>
</ul>
<p>For internal tools, back-office systems, admin consoles, ERP screens and the long tail of business apps, none of that applies, and the split costs more than it returns. These are the apps webforJ is built for. The <a class="" href="https://docs.webforj.com/blog/java-enterprise-web-framework">enterprise checklist</a> and the <a class="" href="https://docs.webforj.com/blog/complete-java-web-platform">complete platform walk-through</a> go deeper on the preceding items, and <a class="" href="https://docs.webforj.com/blog/how-to-build-web-app-java">how to build a web app in Java</a> is the hands-on version.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-webforj">Why this is the stronger choice<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#why-webforj" class="hash-link" aria-label="Direct link to Why this is the stronger choice" title="Direct link to Why this is the stronger choice" translate="no">​</a></h2>
<p>Pick a framework by counting the seams. Every seam between languages, build chains, teams or API contracts is a place where work is duplicated and bugs hide. With a backend framework plus a frontend, the seams sit at the API, the build, the type definitions and the validation rules, which you write once in Java and again in TypeScript. <a class="" href="https://docs.webforj.com/blog/avoid-ui-framework-lock-in">Keeping business logic outside the views</a> also keeps the cost of a later framework change small.</p>
<p>With webforJ, the full-stack Java framework, validation lives on the model, security lives on the route, tests run in the same JUnit build and the deployable is one artifact. A developer who reads Java can read the whole app, and an AI assistant works against one codebase and one set of checked APIs instead of two. That is the case for it, and it holds for the class of apps that most Java teams build. <a class="" href="https://docs.webforj.com/blog/simple-java-web-development">Simple Java web development</a> describes what changes day to day.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="start">Start with one view<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#start" class="hash-link" aria-label="Direct link to Start with one view" title="Direct link to Start with one view" translate="no">​</a></h2>
<p>Generate a Spring Boot project with <a href="https://docs.webforj.com/startforj" target="_blank" rel="noopener noreferrer" class="">startforJ</a>, add one route and one form bound to a model, and run it. The <a class="" href="https://docs.webforj.com/docs/introduction/getting-started">getting started guide</a> covers prerequisites and the first run.</p>
<p>For the approaches themselves, see the comparison of <a class="" href="https://docs.webforj.com/blog/java-frontend-frameworks">Java frontend frameworks</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-best">What is the best Java framework for web applications?<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#faq-best" class="hash-link" aria-label="Direct link to What is the best Java framework for web applications?" title="Direct link to What is the best Java framework for web applications?" translate="no">​</a></h3>
<p>It depends on the app. For business apps where the team writes Java, webforJ, the full-stack Java framework, covers routing, components, forms, security, testing, and deployment in one codebase. For a backend that serves several independent clients, a backend framework such as Spring Boot fits.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-difference">How is a Java web app framework different from a backend framework?<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#faq-difference" class="hash-link" aria-label="Direct link to How is a Java web app framework different from a backend framework?" title="Direct link to How is a Java web app framework different from a backend framework?" translate="no">​</a></h3>
<p>A backend framework handles HTTP, services and data, and leaves the browser UI to a separate JavaScript app. A full-stack framework such as webforJ also covers the screens, so the whole app is Java. They combine well, because webforJ integrates with Spring Boot.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-javascript">Do I need JavaScript for Java web development?<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#faq-javascript" class="hash-link" aria-label="Direct link to Do I need JavaScript for Java web development?" title="Direct link to Do I need JavaScript for Java web development?" translate="no">​</a></h3>
<p>Not for a business app built with webforJ. Views, forms, tables and navigation are written in Java. You can still add custom web components or frontend sources when a project needs them.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-time">How long does Java web app development take with a full-stack framework?<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#faq-time" class="hash-link" aria-label="Direct link to How long does Java web app development take with a full-stack framework?" title="Direct link to How long does Java web app development take with a full-stack framework?" translate="no">​</a></h3>
<p>It depends on the app, so we do not quote a number. What shortens the path is fewer moving parts: one language, one build, no REST layer for your own UI, and generated project structure from startforJ.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-existing-spring">Can I use webforJ with an existing Spring Boot app?<a href="https://docs.webforj.com/blog/java-framework-for-web-applications#faq-existing-spring" class="hash-link" aria-label="Direct link to Can I use webforJ with an existing Spring Boot app?" title="Direct link to Can I use webforJ with an existing Spring Boot app?" translate="no">​</a></h3>
<p>Yes. webforJ integrates with Spring Boot, so views can use your existing services, Spring Data repositories and Spring Security configuration. You add it to the project and build screens in Java next to the code you have.</p><div></div>]]></content:encoded>
            <category>Insights</category>
            <category>Full-Stack</category>
            <category>Spring</category>
        </item>
        <item>
            <title><![CDATA[Selenium vs Playwright for Java: testing a webforJ UI]]></title>
            <link>https://docs.webforj.com/blog/selenium-vs-playwright-java</link>
            <guid>https://docs.webforj.com/blog/selenium-vs-playwright-java</guid>
            <pubDate>Sat, 07 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Selenium vs Playwright for Java UIs: both drive a webforJ app from plain JUnit. Here are the myths, the facts and which one to pick for your suite.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-07-selenium-vs-playwright-java/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>If you're about to write the first browser tests for a Java web app, the tool question comes up fast. One teammate swears by Selenium, another has heard Playwright is easier, and nobody wants to pick wrong and rewrite the suite later.</p>
<p>Selenium vs Playwright for Java turns out to be a gentler choice than it looks with webforJ. A webforJ app is a normal web page in the browser, so both tools drive it from plain JUnit tests, and the webforJ docs ship a working example for each. There is one real difference worth understanding, and it shapes which one suits a new suite.</p>
<p>In this post you'll go through the common myths one at a time, with the fact next to each. The headings are the facts, so you can skim them first and come back for the detail.</p>
<div class="cta_UErl" role="complementary" aria-label="Trying this in your own app?"><div class="copy_XH8h"><p class="title_HfaR">Trying this in your own app?</p><p class="text_x4Wj">Ask the webforJ team when something doesn't fit your case.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="https://docs.webforj.com/startforj/" target="_blank" rel="noopener noreferrer">Start your app<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a><a class="secondary_GDTR" href="mailto:sales@basis.cloud?subject=Question%20about%20a%20webforJ%20tutorial&amp;body=Hi%20webforJ%20team%2C%0A%0A%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Ask by email</a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="myth-special-driver">No special driver is needed<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#myth-special-driver" class="hash-link" aria-label="Direct link to No special driver is needed" title="Direct link to No special driver is needed" translate="no">​</a></h2>
<p><strong>Fact:</strong> webforJ renders standard web components in a standard browser. There is no webforJ-specific driver, plugin or agent to install, and nothing to add to the app itself. The <a class="" href="https://docs.webforj.com/docs/testing/e2e/playwright">Playwright guide</a> and the <a class="" href="https://docs.webforj.com/docs/testing/e2e/selenium">Selenium guide</a> both start from the same place: run the app, point the test at <code>http://localhost:&lt;port&gt;/</code>, and use the tool's regular Java bindings.</p>
<p>The only project-side setup is a test-scoped dependency in your <code>pom.xml</code>. The docs use <code>com.microsoft.playwright:playwright</code> for Playwright, and <code>org.seleniumhq.selenium:selenium-java</code> with WebDriverManager for Selenium.</p>
<p><strong>Recap:</strong> same app, same URL, a single dependency either way.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="myth-selenium-spa">A single-page UI does not break Selenium<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#myth-selenium-spa" class="hash-link" aria-label="Direct link to A single-page UI does not break Selenium" title="Direct link to A single-page UI does not break Selenium" translate="no">​</a></h2>
<p><strong>Fact:</strong> it needs one habit. Here's the concept first. A webforJ app produces a single-page UI, so the DOM is built after the first load. A test that looks up an element the instant the page opens can find nothing. The Selenium guide says so directly and points to <code>WebDriverWait</code>.</p>
<p>The docs example waits for the page title before it touches anything:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">WebDriverWait</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">driver</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">ofSeconds</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token number" style="color:var(--dwc-code-number)">30</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">until</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token function" style="color:var(--dwc-code-function)">titleIs</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"webforJ Hello World"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token class-name" style="color:var(--dwc-code-class)">WebElement</span><span class="token plain"> button </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> driver</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">findElement</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">By</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">tagName</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"dwc-button"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><br></div></code></pre></div></div>
<p>After that, <code>By.tagName</code>, <code>By.id</code> and the other locators work as usual.</p>
<p><strong>Recap:</strong> this is still a fine fit for Selenium. You just write the waits yourself.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="myth-playwright-javascript">Playwright works in Java<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#myth-playwright-javascript" class="hash-link" aria-label="Direct link to Playwright works in Java" title="Direct link to Playwright works in Java" translate="no">​</a></h2>
<p><strong>Fact:</strong> the Playwright team ships first-class <a href="https://playwright.dev/java/docs/intro" target="_blank" rel="noopener noreferrer" class="">Java bindings</a>, and the webforJ docs test with them from JUnit. A full test for the hello world view looks like this:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">GreetingFlowTest</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">static</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Playwright</span><span class="token plain"> playwright</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">static</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Browser</span><span class="token plain"> browser</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token class-name" style="color:var(--dwc-code-class)">Page</span><span class="token plain"> page</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@BeforeAll</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">static</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">launch</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    playwright </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Playwright</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">create</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    browser </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> playwright</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">chromium</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">launch</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@AfterAll</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">static</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">close</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    playwright</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">close</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@BeforeEach</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">open</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    page </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> browser</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">newPage</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    page</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">navigate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"http://localhost:"</span><span class="token plain"> </span><span class="token operator" style="color:var(--dwc-code-operator)">+</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">System</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getProperty</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"server.port"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"8080"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token operator" style="color:var(--dwc-code-operator)">+</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"/"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Test</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">greetsTheUser</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    page</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"input"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">fill</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"webforJ"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    page</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getByText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Say Hello"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">click</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token function" style="color:var(--dwc-code-function)">assertThat</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">page</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"dwc-toast"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">first</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">        </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">containsText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Welcome to webforJ Starter webforJ!"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>Notice there's no explicit wait anywhere. Playwright <a href="https://playwright.dev/java/docs/actionability" target="_blank" rel="noopener noreferrer" class="">checks that an element is ready</a> before it acts on it, and the <a href="https://playwright.dev/java/docs/test-assertions" target="_blank" rel="noopener noreferrer" class="">web-first assertion</a> <code>assertThat(...).containsText(...)</code> keeps retrying until the toast shows up or the timeout ends.</p>
<p><strong>Recap:</strong> for a UI where the server decides what appears next, Playwright's waiting is the behavior you want out of the box.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="myth-pick-one">Picking one is not a lock-in<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#myth-pick-one" class="hash-link" aria-label="Direct link to Picking one is not a lock-in" title="Direct link to Picking one is not a lock-in" translate="no">​</a></h2>
<p><strong>Fact:</strong> both approaches test the same running app through the same URL. The test classes are JUnit, they run with <code>mvn test</code>, and the app starts the same way for either one: <code>mvn jetty:run</code>. Switching later means rewriting test code, not the app. Since the tests are plain JUnit classes, a suite can move from one tool to the other one class at a time.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="myth-e2e-replaces-unit">E2E tests do not replace unit tests<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#myth-e2e-replaces-unit" class="hash-link" aria-label="Direct link to E2E tests do not replace unit tests" title="Direct link to E2E tests do not replace unit tests" translate="no">​</a></h2>
<p><strong>Fact:</strong> browser tests are the slowest and most expensive layer, so they should cover whole user journeys, not every branch of your logic. The <a class="" href="https://docs.webforj.com/docs/testing/overview">testing overview</a> recommends combining layers, and since 26.03 there's one more layer between unit tests and the browser.</p>
<p>The <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a> runs a webforJ view inside a plain JUnit test without a browser or a server. It finds components the way a user picks them out, types and clicks, and checks the result. So a check like "this button updates the total" no longer needs Selenium or Playwright at all.</p>
<p><strong>Recap:</strong> rules go in unit tests, view behavior goes in the TestBed, and the browser keeps what only a browser can show.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-to-test">What to test in the browser<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#what-to-test" class="hash-link" aria-label="Direct link to What to test in the browser" title="Direct link to What to test in the browser" translate="no">​</a></h2>
<p>Pick journeys, not screens. A good browser test in a webforJ app does one thing a user would do and checks one visible result:</p>
<ol>
<li class="">Open the route and wait for the first component to render.</li>
<li class="">Fill a field, click a button, or choose a row.</li>
<li class="">Assert on what the user sees, such as a <code>dwc-toast</code> message or the text of a <code>dwc-button</code>.</li>
</ol>
<p>Both guides locate webforJ components by their rendered tags and visible text. That keeps the tests close to what a person would describe, and independent of how the Java view is structured.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="running-suite">Running the suite<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#running-suite" class="hash-link" aria-label="Direct link to Running the suite" title="Direct link to Running the suite" translate="no">​</a></h2>
<p>The workflow is the same for both tools, because both guides use the same two commands. Start the app in one terminal with <code>mvn jetty:run</code>, then run <code>mvn test</code> in another. The port comes from the <code>server.port</code> system property and falls back to <code>8080</code>, so a test class can point at whatever port you started the app on.</p>
<p>That makes the tests easy to reason about. The browser opens a URL, the page renders, and the test asserts on what's on screen. No part of the app has to know a test exists.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="which-one">Which one should you pick?<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#which-one" class="hash-link" aria-label="Direct link to Which one should you pick?" title="Direct link to Which one should you pick?" translate="no">​</a></h2>
<p>Here's how the two compare on a webforJ app:</p>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th></th><th>Selenium</th><th>Playwright</th></tr></thead><tbody><tr><td>Java bindings and JUnit</td><td>Yes</td><td>Yes</td></tr><tr><td>Works with webforJ unchanged</td><td>Yes</td><td>Yes</td></tr><tr><td>Waiting for the dynamic DOM</td><td>You add <code>WebDriverWait</code></td><td>Built into actions and assertions</td></tr><tr><td>Browser setup</td><td>WebDriverManager in the docs example</td><td>Playwright can install browsers during setup</td></tr><tr><td>Locator style</td><td><code>By.tagName</code>, <code>By.id</code></td><td><code>locator</code>, <code>getByText</code></td></tr><tr><td>Best fit</td><td>Teams with an existing Selenium suite</td><td>New suites</td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<p>The row that matters most for webforJ is the third one. A toast, a dialog or a table row is rendered into the page after the click, not before it. A tool that waits for the element by default means fewer hand-written waits, and your test code stays focused on what the user does.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="best-e2e-framework-java">Best e2e framework for Java: a simple rule<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#best-e2e-framework-java" class="hash-link" aria-label="Direct link to Best e2e framework for Java: a simple rule" title="Direct link to Best e2e framework for Java: a simple rule" translate="no">​</a></h2>
<p>Start new webforJ projects with Playwright. Keep Selenium where it already runs. Whichever you use, put most of your confidence in <a class="" href="https://docs.webforj.com/blog/java-web-app-testing-strategy">fast JUnit and TestBed tests</a>, and save the browser for the handful of journeys that must never break: sign in, create a record, submit a form.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="first-browser-test">Write your first browser test<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#first-browser-test" class="hash-link" aria-label="Direct link to Write your first browser test" title="Direct link to Write your first browser test" translate="no">​</a></h2>
<p>Generate a project from <a href="https://docs.webforj.com/startforj" target="_blank" rel="noopener noreferrer" class="">startforJ</a>, run it with <code>mvn jetty:run</code>, and paste the Playwright test from earlier next to it. The hello world view is enough to get a first browser test passing. The <a class="" href="https://docs.webforj.com/docs/introduction/getting-started">getting started guide</a> covers the project setup.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-best-e2e">What is the best e2e framework for Java?<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#faq-best-e2e" class="hash-link" aria-label="Direct link to What is the best e2e framework for Java?" title="Direct link to What is the best e2e framework for Java?" translate="no">​</a></h3>
<p>For a webforJ app, Playwright is the easier start for new suites, since it waits for the dynamic DOM by default. Selenium works equally well when you add explicit waits, and the webforJ docs cover both.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-playwright-or-selenium">Playwright or Selenium for Java, which one?<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#faq-playwright-or-selenium" class="hash-link" aria-label="Direct link to Playwright or Selenium for Java, which one?" title="Direct link to Playwright or Selenium for Java, which one?" translate="no">​</a></h3>
<p>Use the one your team can maintain. If you have no suite yet, Playwright is the shorter path. If you already have Selenium tests, a webforJ app needs no changes to keep using them.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-change-app">Do I need to change my webforJ app to test it in a browser?<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#faq-change-app" class="hash-link" aria-label="Direct link to Do I need to change my webforJ app to test it in a browser?" title="Direct link to Do I need to change my webforJ app to test it in a browser?" translate="no">​</a></h3>
<p>No. Both tools open the running app at its URL and interact with the rendered components, so the app code stays as it is. Start the server with <code>mvn jetty:run</code>, then run <code>mvn test</code>.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-browser-testing-speed">How do I do browser testing in Java without slowing down the build?<a href="https://docs.webforj.com/blog/selenium-vs-playwright-java#faq-browser-testing-speed" class="hash-link" aria-label="Direct link to How do I do browser testing in Java without slowing down the build?" title="Direct link to How do I do browser testing in Java without slowing down the build?" translate="no">​</a></h3>
<p>Keep browser tests to full user journeys. Test logic with plain JUnit and view behavior with the <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a>, which needs no browser. This split keeps the browser layer small.</p><div></div>]]></content:encoded>
            <category>Tutorial</category>
            <category>Performance</category>
        </item>
        <item>
            <title><![CDATA[The AI coding agent verification loop for Java]]></title>
            <link>https://docs.webforj.com/blog/ai-verification-loop-java</link>
            <guid>https://docs.webforj.com/blog/ai-verification-loop-java</guid>
            <pubDate>Fri, 06 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How webforJ closes the AI coding agent verification loop in Java: skills, MCP docs checks, compiled edits and browserless tests, installed with one plugin.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-06-ai-verification-loop-java/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>You ask a coding agent for a new screen and it comes back fast, confident, and half wrong. A method that does not exist, a CSS token it made up, a build that fails on the second line, and a button that nobody ever clicked. The model is rarely the problem. The missing piece is verification.</p>
<p>The AI coding agent verification loop is the set of checks that turns a guess into code you can trust: write with known workflows, check every API against the real docs, compile every edit, and run a test on every change. webforJ, the <a class="" href="https://docs.webforj.com/blog/java-full-stack-framework">full-stack Java framework</a>, closes that whole loop with Agent Skills, an MCP server, the craftforJ Assistant and the TestBed, and one plugin installs the first two for Claude Code, Copilot, Gemini, and Codex. Cursor and other clients use manual setup. Because of that loop, webforJ is the most AI-ready framework in the Java ecosystem.</p>
<div class="cta_UErl" role="complementary" aria-label="Using AI to build Java apps?"><div class="copy_XH8h"><p class="title_HfaR">Using AI to build Java apps?</p><p class="text_x4Wj">Ask the team about webforJ AI tooling: the MCP server, Agent Skills, and how they keep generated code correct.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a><a class="secondary_GDTR" href="mailto:sales@basis.cloud?subject=AI%20and%20webforJ&amp;body=Hi%20webforJ%20team%2C%0A%0A%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Ask by email</a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-problem">The problem with unverified agents<a href="https://docs.webforj.com/blog/ai-verification-loop-java#the-problem" class="hash-link" aria-label="Direct link to The problem with unverified agents" title="Direct link to The problem with unverified agents" translate="no">​</a></h2>
<p>An agent that writes code without checking it is doing autocomplete with extra steps. It recalls what a class probably looks like from training data, and for a framework that changes between versions that memory is often stale. Which framework you pair with an agent matters too, and the <a class="" href="https://docs.webforj.com/blog/best-java-ui-frameworks">best Java UI framework for business apps</a> is a place to start.</p>
<p>The failures fall into four groups, and each one needs a different check:</p>
<ul>
<li class="">The agent invents or misremembers an API.</li>
<li class="">The agent follows generic habits instead of the conventions of your framework.</li>
<li class="">The code does not compile, and you find out when you build.</li>
<li class="">The code compiles and still does the wrong thing, and you find out in production.</li>
</ul>
<p>Reviewing all four by hand is the cost people complain about when they say AI code is not worth the trouble. A single check cannot remove it. A loop of checks can, because each step catches what the step before it let through. The rest of this post walks the loop in order. A separate post covers <a class="" href="https://docs.webforj.com/blog/ai-generated-java-code-guardrails">quality control for AI-generated Java code</a> with the same pieces.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="skills">Step 1: skills write the code<a href="https://docs.webforj.com/blog/ai-verification-loop-java#skills" class="hash-link" aria-label="Direct link to Step 1: skills write the code" title="Direct link to Step 1: skills write the code" translate="no">​</a></h2>
<p>The first check happens before any code exists. <a class="" href="https://docs.webforj.com/docs/ai-tooling/agent-skills">Agent Skills</a> are structured webforJ workflows that the assistant loads when your prompt matches a task. They tell it how to classify the work, which patterns fit, which tools to consult and how to validate the result, so the code compiles and follows best practices on the first attempt.</p>
<p>The skills cover adding servlets, building forms, creating components, handling timers and async work, localizing apps, securing apps, styling apps, and upgrading versions. This is the difference between code that is technically valid and code that looks like it belongs in your project.</p>
<p>What it catches: convention drift. The agent reaches for webforJ's own approach instead of a generic one.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="mcp">Step 2: the MCP server checks every API<a href="https://docs.webforj.com/blog/ai-verification-loop-java#mcp" class="hash-link" aria-label="Direct link to Step 2: the MCP server checks every API" title="Direct link to Step 2: the MCP server checks every API" translate="no">​</a></h2>
<p>Skills say when to look something up. The <a class="" href="https://docs.webforj.com/docs/ai-tooling/mcp">MCP server</a> is what answers. It plugs the assistant into the webforJ documentation, APIs and design tokens, so it asks the server instead of guessing at method names.</p>
<p>With our MCP server, the assistant can target the webforJ version you use, search the knowledge base, scaffold a project from the official Maven archetypes, generate an accessible DWC theme from a brand color, read the styling surface of a component and validate any <code>--dwc-*</code> token before it lands in your CSS.</p>
<p>That last one is a real example of the pattern. A token the agent invented fails validation against the catalog, so it never reaches your stylesheet.</p>
<p>What it catches: invented classes, wrong signatures and made-up design tokens.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="craftforj">Step 3: a real compiler checks each edit<a href="https://docs.webforj.com/blog/ai-verification-loop-java#craftforj" class="hash-link" aria-label="Direct link to Step 3: a real compiler checks each edit" title="Direct link to Step 3: a real compiler checks each edit" translate="no">​</a></h2>
<p>Some mistakes survive a docs lookup, so the next check has to be a compiler. A type is wrong, an import is missing, a call does not fit the object it is called on. Only a compiler sees those.</p>
<p>The <a class="" href="https://docs.webforj.com/docs/ai-tooling/craftforj-assistant">craftforJ Assistant</a> is a coding agent that works inside your running app. Each edit is staged rather than written to disk, sent to a real Java compiler, and corrected by the agent against the diagnostics that come back. What reaches your review already compiles against your running app. Applying the edit restarts the app, and the agent picks its plan up again once it is back. This is its own agent, so it needs a model of your choice configured, and craftforJ runs only in development.</p>
<p>It also reads the live component tree, real property values, the routing table and screenshots of a component, so it works from what the app does and not from a description of it.</p>
<p>What it catches: compile errors, before you ever see them.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="testbed">Step 4: TestBed proves the behavior<a href="https://docs.webforj.com/blog/ai-verification-loop-java#testbed" class="hash-link" aria-label="Direct link to Step 4: TestBed proves the behavior" title="Direct link to Step 4: TestBed proves the behavior" translate="no">​</a></h2>
<p>Compiling is not the same as working. The last gap is behavior, and the usual answer, a browser test, is slow enough that agents and humans both skip it.</p>
<p>The <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a> runs a view inside a plain JUnit test. No browser is opened and no server is started. Every interaction finishes before the next line of the test runs, so nothing waits and nothing flakes. That is what makes it practical to run tests on every change an agent makes. This is the example from the getting started page:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">GreetingFormTest.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@WebforjTest</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">GreetingFormTest</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Test</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">shouldGreetTheNameTheUserTyped</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">WebforjTestbed</span><span class="token plain"> context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">GreetingForm</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token keyword" style="color:var(--dwc-code-keyword)">var</span><span class="token plain"> name </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">byLabel</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Name"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token keyword" style="color:var(--dwc-code-keyword)">var</span><span class="token plain"> greet </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">byText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Greet"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">UserInteraction</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">type</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">name</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"Ada"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">UserInteraction</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">click</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">greet</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token function" style="color:var(--dwc-code-function)">verifyThat</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">        </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">hasText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Hello, Ada!"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>The test reads like the steps of a user, and <code>UserInteraction</code> only makes gestures a user could make. Clicking a disabled button fails the test instead of running its listener, which is exactly the kind of bug an unverified agent ships. Snapshots compare a whole view against a stored description of it, so an agent that changes more than you asked for shows up as a diff. The mechanics are covered in <a class="" href="https://docs.webforj.com/blog/java-ui-testing-without-browser">Java UI testing without a browser</a>.</p>
<p>Browser tests still have their place for styling, layout, and client behavior. The TestBed covers the rest: what your views do when a user works with them.</p>
<p>What it catches: behavior that compiles and is still wrong.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="plugin">Step 5: one plugin installs the loop<a href="https://docs.webforj.com/blog/ai-verification-loop-java#plugin" class="hash-link" aria-label="Direct link to Step 5: one plugin installs the loop" title="Direct link to Step 5: one plugin installs the loop" translate="no">​</a></h2>
<p>You do not wire these pieces together yourself. The <a class="" href="https://docs.webforj.com/docs/ai-tooling">webforJ AI plugin</a> installs the MCP server and the Agent Skills in one step for Claude Code, GitHub Copilot, Gemini CLI and OpenAI Codex CLI. Cursor and other clients that support Agent Skills use manual configuration. The craftforJ Assistant ships with webforJ itself, so there is nothing extra to install beyond turning it on in development, and the TestBed is a test-scope dependency.</p>
<p>For Claude Code it is two commands:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">claude plugin marketplace </span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token plain"> webforj/webforj-ai</span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">claude plugin </span><span class="token function" style="color:var(--dwc-code-function)">install</span><span class="token plain"> webforj@webforj-ai</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="loop-table">The loop at a glance<a href="https://docs.webforj.com/blog/ai-verification-loop-java#loop-table" class="hash-link" aria-label="Direct link to The loop at a glance" title="Direct link to The loop at a glance" translate="no">​</a></h2>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th>Step</th><th>What it checks</th><th>Docs page</th></tr></thead><tbody><tr><td>Agent Skills</td><td>The agent follows webforJ workflows and conventions</td><td><a class="" href="https://docs.webforj.com/docs/ai-tooling/agent-skills">Agent Skills</a></td></tr><tr><td>MCP server</td><td>APIs, docs answers and <code>--dwc-*</code> tokens against the real sources</td><td><a class="" href="https://docs.webforj.com/docs/ai-tooling/mcp">MCP server</a></td></tr><tr><td>craftforJ Assistant</td><td>Each edit compiles with a real Java compiler</td><td><a class="" href="https://docs.webforj.com/docs/ai-tooling/craftforj-assistant">craftforJ Assistant</a></td></tr><tr><td>TestBed</td><td>Behavior, through JUnit tests with no browser and no server</td><td><a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a></td></tr><tr><td>AI plugin</td><td>Skills and MCP installed together in one step</td><td><a class="" href="https://docs.webforj.com/docs/ai-tooling">AI plugin</a></td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-a-loop">Why this is a loop, not a toolbox<a href="https://docs.webforj.com/blog/ai-verification-loop-java#why-a-loop" class="hash-link" aria-label="Direct link to Why this is a loop, not a toolbox" title="Direct link to Why this is a loop, not a toolbox" translate="no">​</a></h2>
<p>Each tool alone is useful. Together they cover the failure modes in order. Skills reduce wrong approaches, the MCP server reduces wrong facts, the compiler removes wrong code, and the tests remove wrong behavior. By the time something reaches your review, the mistakes each layer targets are already filtered out. A wider look at <a class="" href="https://docs.webforj.com/blog/ai-java-web-framework">how webforJ is built for AI work</a> adds an agent in your running app and agents that use your UI.</p>
<p>This works because the whole app is Java. There is no template language or separate front end for the agent to get out of sync with, so the compiler and a JUnit test can see everything the agent changed. For the framework-level argument, see <a class="" href="https://docs.webforj.com/blog/java-framework-for-ai-coding">why webforJ fits AI coding</a>.</p>
<p>To be clear about the limit: even with the plugin, AI assistants can produce incorrect code in complex scenarios. The loop lowers what you have to catch yourself. It does not replace your review.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="next-step">Set it up in your project<a href="https://docs.webforj.com/blog/ai-verification-loop-java#next-step" class="hash-link" aria-label="Direct link to Set it up in your project" title="Direct link to Set it up in your project" translate="no">​</a></h2>
<p>Install the plugin from the <a class="" href="https://docs.webforj.com/docs/ai-tooling">AI tooling page</a>, mention webforJ in your prompts so the assistant reaches for it, and add the <code>webforj-testbed-junit</code> dependency with test scope. Then ask for one small screen and ask for a test with it. Spring Boot apps use the <code>webforj-spring-testbed</code> module instead.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/ai-verification-loop-java#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-what-is-it">What is an AI coding agent verification loop?<a href="https://docs.webforj.com/blog/ai-verification-loop-java#faq-what-is-it" class="hash-link" aria-label="Direct link to What is an AI coding agent verification loop?" title="Direct link to What is an AI coding agent verification loop?" translate="no">​</a></h3>
<p>It is the chain of checks between a prompt and merged code: the agent writes with known workflows, checks APIs against real documentation, compiles its edits, and runs tests. In webforJ those steps are Agent Skills, the MCP server, the craftforJ Assistant and the TestBed.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-reliable">How do I make AI-generated Java code reliable?<a href="https://docs.webforj.com/blog/ai-verification-loop-java#faq-reliable" class="hash-link" aria-label="Direct link to How do I make AI-generated Java code reliable?" title="Direct link to How do I make AI-generated Java code reliable?" translate="no">​</a></h3>
<p>Do not rely on one check. Ground the agent in the real docs, make it compile each edit and require a test for each change. With webforJ the AI plugin covers the first part, the craftforJ Assistant covers compiling and the TestBed covers tests.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-no-browser">Can I test AI-generated code without a browser?<a href="https://docs.webforj.com/blog/ai-verification-loop-java#faq-no-browser" class="hash-link" aria-label="Direct link to Can I test AI-generated code without a browser?" title="Direct link to Can I test AI-generated code without a browser?" translate="no">​</a></h3>
<p>Yes. The webforJ TestBed runs views and components in plain JUnit tests without a browser or a server. The test adds the view, acts on it the way a user does and checks the result from Java.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq-assistants">Which AI assistants work with the webforJ plugin?<a href="https://docs.webforj.com/blog/ai-verification-loop-java#faq-assistants" class="hash-link" aria-label="Direct link to Which AI assistants work with the webforJ plugin?" title="Direct link to Which AI assistants work with the webforJ plugin?" translate="no">​</a></h3>
<p>The plugin installs for Claude Code, GitHub Copilot, Gemini CLI and OpenAI Codex CLI. Cursor and other clients that support Agent Skills, such as Kiro, Goose, Junie and Antigravity, use manual configuration.</p><div></div>]]></content:encoded>
            <category>AI</category>
            <category>MCP</category>
        </item>
        <item>
            <title><![CDATA[Java web app testing strategy: what to test, and where]]></title>
            <link>https://docs.webforj.com/blog/java-web-app-testing-strategy</link>
            <guid>https://docs.webforj.com/blog/java-web-app-testing-strategy</guid>
            <pubDate>Fri, 06 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[A Java web app testing strategy for webforJ: JUnit for logic, TestBed for views without a browser, Bun for frontend code, and a few browser tests for journeys.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-06-java-web-app-testing-strategy/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>Your app works on your machine. Then a refactor lands, a button stops doing its job, and nobody notices until a user does. Most teams know they need tests. The hard part is deciding which kind goes where, so the suite stays fast and people still trust a red build.</p>
<p>A Java web app testing strategy answers that question layer by layer. In webforJ every layer runs from JUnit in one Maven build, and the newest one tests your views without opening a browser at all.</p>
<p>This guide walks through the four layers, what each one catches, and how to keep the slow layer small.</p>
<div class="cta_UErl" role="complementary" aria-label="Trying this in your own app?"><div class="copy_XH8h"><p class="title_HfaR">Trying this in your own app?</p><p class="text_x4Wj">Ask the webforJ team when something doesn't fit your case.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="https://docs.webforj.com/startforj/" target="_blank" rel="noopener noreferrer">Start your app<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a><a class="secondary_GDTR" href="mailto:sales@basis.cloud?subject=Question%20about%20a%20webforJ%20tutorial&amp;body=Hi%20webforJ%20team%2C%0A%0A%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Ask by email</a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="testing-pyramid">The testing pyramid for a Java UI<a href="https://docs.webforj.com/blog/java-web-app-testing-strategy#testing-pyramid" class="hash-link" aria-label="Direct link to The testing pyramid for a Java UI" title="Direct link to The testing pyramid for a Java UI" translate="no">​</a></h2>
<p>The classic testing pyramid puts many fast tests at the bottom and a few slow ones at the top. The idea holds for a Java UI. In webforJ the UI is written in Java, so the line between "logic" and "view" is a design choice, not a language boundary.</p>
<p>webforJ <a class="" href="https://docs.webforj.com/docs/testing/overview">testing</a> gives you four layers:</p>
<ol>
<li class=""><strong>Unit tests</strong> check business logic with JUnit.</li>
<li class=""><strong>TestBed tests</strong> run views and components in plain JUnit, with no browser and no server.</li>
<li class=""><strong>Frontend tests</strong> cover TypeScript or JavaScript sources you author with the frontend bundler.</li>
<li class=""><strong>End-to-end tests</strong> drive a real browser against the running app with Selenium or Playwright.</li>
</ol>
<p>Each layer answers one question. Is this rule correct? Does this view behave when a user works with it? Does this client code behave? Does the page look and work right in a real browser?</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="unit-tests">Unit tests: keep logic out of views<a href="https://docs.webforj.com/blog/java-web-app-testing-strategy#unit-tests" class="hash-link" aria-label="Direct link to Unit tests: keep logic out of views" title="Direct link to Unit tests: keep logic out of views" translate="no">​</a></h2>
<p>Most bugs in a business app live in rules: pricing, validation, eligibility, state transitions. None of them need a view. Put them in a plain Java class and a JUnit test checks them in milliseconds.</p>
<p>Keep views thin. A view builds components and wires events. A service decides the answer. The <a class="" href="https://docs.webforj.com/blog/webforj-mvc">MVC post</a> shows this split in a real webforJ app.</p>
<p>Here is a small service with a rule worth testing:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">DiscountService.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">DiscountService</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">BigDecimal</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">apply</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">BigDecimal</span><span class="token plain"> total</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">String</span><span class="token plain"> code</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token keyword" style="color:var(--dwc-code-keyword)">if</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"SAVE10"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">equals</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">code</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">      </span><span class="token keyword" style="color:var(--dwc-code-keyword)">return</span><span class="token plain"> total</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">multiply</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">BigDecimal</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"0.90"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setScale</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token number" style="color:var(--dwc-code-number)">2</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">RoundingMode</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token constant" style="color:var(--dwc-code-number)">HALF_UP</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token keyword" style="color:var(--dwc-code-keyword)">return</span><span class="token plain"> total</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>And the JUnit test that pins its behavior:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">DiscountServiceTest.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">DiscountServiceTest</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">final</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">DiscountService</span><span class="token plain"> service </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">DiscountService</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Test</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">knownCodeTakesTenPercentOff</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token function" style="color:var(--dwc-code-function)">assertEquals</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">BigDecimal</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"90.00"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> service</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">apply</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">BigDecimal</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"100.00"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"SAVE10"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Test</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">unknownCodeLeavesTotalUnchanged</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token function" style="color:var(--dwc-code-function)">assertEquals</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">BigDecimal</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"100.00"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> service</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">apply</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">BigDecimal</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"100.00"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"NOPE"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>No server, no browser, no setup. Hundreds of tests like this finish in seconds. JUnit 5 runs them, Mockito stands in for repositories, and Spring's test support helps when the service is a bean.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="testbed-tests">Test views without a browser<a href="https://docs.webforj.com/blog/java-web-app-testing-strategy#testbed-tests" class="hash-link" aria-label="Direct link to Test views without a browser" title="Direct link to Test views without a browser" translate="no">​</a></h2>
<p>A unit test can't tell you that the <strong>Apply code</strong> button is wired to the right handler. That used to mean a browser test. Since 26.03 the <a class="" href="https://docs.webforj.com/docs/testing/testbed/overview">TestBed</a> covers it in plain JUnit. The view runs inside the test, components fire their events as they do in the running app, and every interaction finishes before the next line runs. Nothing waits and nothing flakes.</p>
<p>Here is a checkout view that uses the service:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">CheckoutView.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">CheckoutView</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">extends</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Composite</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token generics class-name" style="color:var(--dwc-code-class)">Div</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">final</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">DiscountService</span><span class="token plain"> discounts </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">DiscountService</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">CheckoutView</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token plain"> code </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Discount code"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token plain"> total </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Total: 100.00"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token plain"> apply </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Apply code"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">        e </span><span class="token operator" style="color:var(--dwc-code-operator)">-&gt;</span><span class="token plain"> total</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Total: "</span><span class="token plain"> </span><span class="token operator" style="color:var(--dwc-code-operator)">+</span><span class="token plain"> discounts</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">apply</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">BigDecimal</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"100.00"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> code</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getValue</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token function" style="color:var(--dwc-code-function)">getBoundComponent</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">code</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> apply</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> total</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>The test does what a user does. It finds the field by its label, types a code, clicks the button, and checks the total:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">CheckoutViewTest.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@WebforjTest</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">CheckoutViewTest</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Test</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">discountCodeUpdatesTheTotal</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">WebforjTestbed</span><span class="token plain"> context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    context</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">CheckoutView</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token keyword" style="color:var(--dwc-code-keyword)">var</span><span class="token plain"> code </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">byLabel</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Discount code"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token keyword" style="color:var(--dwc-code-keyword)">var</span><span class="token plain"> apply </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">byText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Apply code"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">UserInteraction</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">type</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">code</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"SAVE10"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">UserInteraction</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">click</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">apply</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token function" style="color:var(--dwc-code-function)">verifyThat</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">ComponentLocator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">of</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">Paragraph</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">hasText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Total: 90.00"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>The app isn't running and no browser opens. The test only needs the <code>webforj-testbed-junit</code> dependency with test scope, and the <a class="" href="https://docs.webforj.com/docs/testing/testbed/getting-started">getting started page</a> shows the setup. Beyond single views, the TestBed navigates routes, tests secured views, answers dialogs and runs timers, as <a class="" href="https://docs.webforj.com/docs/testing/testbed/testing-apps">testing apps</a> shows. Spring Boot apps use the <code>webforj-spring-testbed</code> module instead.</p>
<p>This layer moves most UI checks out of the browser. The full walkthrough is in <a class="" href="https://docs.webforj.com/blog/java-ui-testing-without-browser">Java UI testing without a browser</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="frontend-tests">Frontend tests: cover your client code<a href="https://docs.webforj.com/blog/java-web-app-testing-strategy#frontend-tests" class="hash-link" aria-label="Direct link to Frontend tests: cover your client code" title="Direct link to Frontend tests: cover your client code" translate="no">​</a></h2>
<p>Some apps ship their own client code, such as a custom element written in TypeScript or a helper that formats values in the browser. When a project authors those sources with the <a class="" href="https://docs.webforj.com/docs/managing-resources/bundler/overview">frontend bundler</a>, webforJ tests them with the <a href="https://bun.sh/" target="_blank" rel="noopener noreferrer" class="">Bun</a> test runner.</p>
<p>Tests live under <code>src/main/frontend</code> next to the code they cover. A file named <code>*.test.ts</code> or <code>*.spec.ts</code> is picked up as a test, and it imports <code>expect</code>, <code>test</code> and <code>describe</code> from <code>bun:test</code>. These tests run in the same build as the Java tests, and a failing one fails the build. The <a class="" href="https://docs.webforj.com/docs/testing/frontend-testing">frontend testing page</a> has the layout and a runnable example, and the <a class="" href="https://docs.webforj.com/docs/managing-resources/bundler/build-and-tests#frontend-tests">build and tests page</a> explains the test step.</p>
<p>No custom frontend sources? Skip this layer. Plenty of webforJ apps are pure Java.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="end-to-end-tests">Browser tests for key journeys<a href="https://docs.webforj.com/blog/java-web-app-testing-strategy#end-to-end-tests" class="hash-link" aria-label="Direct link to Browser tests for key journeys" title="Direct link to Browser tests for key journeys" translate="no">​</a></h2>
<p>Some questions only a real browser can answer: styling, layout, and how the page behaves on the client. That's the end-to-end layer. It confirms the server, the components, and the browser work together.</p>
<p>Java teams usually pick <a class="" href="https://docs.webforj.com/docs/testing/e2e/playwright">Playwright</a> or <a class="" href="https://docs.webforj.com/docs/testing/e2e/selenium">Selenium</a>. Both run from JUnit, so they fit the same <code>mvn test</code> flow. Here is a Playwright test in the shape the docs use, filling a field, clicking a button and checking the toast webforJ renders:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockTitle_OeMC">CheckoutJourneyTest.java</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">CheckoutJourneyTest</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">static</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Playwright</span><span class="token plain"> playwright</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">static</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Browser</span><span class="token plain"> browser</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@BeforeAll</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">static</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">launch</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    playwright </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Playwright</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">create</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    browser </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> playwright</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">chromium</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">launch</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@AfterAll</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">static</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">close</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    playwright</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">close</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Test</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">void</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">discountCodeShowsConfirmation</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token class-name" style="color:var(--dwc-code-class)">Page</span><span class="token plain"> page </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> browser</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">newPage</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    page</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">navigate</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"http://localhost:8080/checkout"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    page</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"input"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">fill</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"SAVE10"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    page</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getByText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Apply code"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">click</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    </span><span class="token function" style="color:var(--dwc-code-function)">assertThat</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">page</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">locator</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"dwc-toast"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">first</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">containsText</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Discount applied"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>The app has to be running for this test to pass, so start it with <code>mvn jetty:run</code>, then run <code>mvn test</code>. That setup cost is why this layer stays small. The post on <a class="" href="https://docs.webforj.com/blog/selenium-vs-playwright-java">choosing between Selenium and Playwright</a> for a webforJ suite covers the trade-offs.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="which-test-goes-where">Which test goes where<a href="https://docs.webforj.com/blog/java-web-app-testing-strategy#which-test-goes-where" class="hash-link" aria-label="Direct link to Which test goes where" title="Direct link to Which test goes where" translate="no">​</a></h2>
<p>Use this table when you're unsure where a new test belongs.</p>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th>What you want to check</th><th>Layer</th><th>Why</th></tr></thead><tbody><tr><td>A pricing, validation or eligibility rule</td><td>JUnit unit test</td><td>Fast, exact failure</td></tr><tr><td>A service with mocked collaborators</td><td>JUnit unit test</td><td>Plain Java, standard tooling</td></tr><tr><td>A button runs the right handler and the view updates</td><td>TestBed test</td><td>No browser, no server</td></tr><tr><td>A route loads, a secured view blocks, a dialog answers</td><td>TestBed test</td><td>Runs the real components in JUnit</td></tr><tr><td>A TypeScript helper or custom element logic</td><td>Bun frontend test</td><td>Runs in the same Maven build</td></tr><tr><td>Layout and styling in different browsers or devices</td><td>End-to-end test</td><td>Only a real browser can answer it</td></tr><tr><td>One full journey through the deployed stack</td><td>End-to-end test</td><td>Checks server and browser together</td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<p>Rule of thumb: push every check as far down as it can go. If the TestBed can answer it, don't open a browser for it.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="keep-e2e-small">Keep the end-to-end layer small<a href="https://docs.webforj.com/blog/java-web-app-testing-strategy#keep-e2e-small" class="hash-link" aria-label="Direct link to Keep the end-to-end layer small" title="Direct link to Keep the end-to-end layer small" translate="no">​</a></h2>
<p>A common mistake is inverting the pyramid: a few unit tests and a long list of slow browser tests. The suite takes ten minutes, flakes on timing, and people stop trusting red builds.</p>
<p>Four habits keep the top layer healthy:</p>
<ol>
<li class=""><strong>One test per journey, not per field.</strong> Cover sign in, create an order, and the other paths that would hurt if they broke.</li>
<li class=""><strong>Move view behavior to the TestBed.</strong> Clicks, field values and navigation don't need a browser anymore.</li>
<li class=""><strong>Use stable locators.</strong> Prefer visible text and roles over deep CSS paths that break when markup changes.</li>
<li class=""><strong>Run it last.</strong> Let the fast layers fail first, so a broken rule never costs you a browser launch.</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-webforj">Why this works well in webforJ<a href="https://docs.webforj.com/blog/java-web-app-testing-strategy#why-webforj" class="hash-link" aria-label="Direct link to Why this works well in webforJ" title="Direct link to Why this works well in webforJ" translate="no">​</a></h2>
<p>One language and one build make the strategy cheap to follow. The UI, the services and the tests are all Java. The developer who writes a view also writes its unit test, its TestBed test and its Playwright test, without switching context. Frontend tests join the same <code>mvn test</code> run when the project has client code. One command, one report, one place for CI to look.</p>
<p>There's no REST contract between a client and a server to test separately, and no second test stack that drifts apart from the first.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="add-a-testbed-test">Add a TestBed test today<a href="https://docs.webforj.com/blog/java-web-app-testing-strategy#add-a-testbed-test" class="hash-link" aria-label="Direct link to Add a TestBed test today" title="Direct link to Add a TestBed test today" translate="no">​</a></h2>
<p>A short checklist to start:</p>
<ul>
<li class="">Move one rule out of a view into a service and pin it with a JUnit test.</li>
<li class="">Add <code>webforj-testbed-junit</code> with test scope and write one TestBed test for the view that uses it.</li>
<li class="">Keep a single Playwright test for the journey end to end.</li>
<li class="">Run <code>mvn test</code> and watch all three pass in one build.</li>
</ul>
<p>The <a class="" href="https://docs.webforj.com/docs/testing/overview">testing overview</a> lists every testing page, and <a class="" href="https://docs.webforj.com/docs/introduction/getting-started">getting started</a> creates a project you can try this in.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/java-web-app-testing-strategy#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="best-way-to-test-java-web-ui">How do you test a Java web UI?<a href="https://docs.webforj.com/blog/java-web-app-testing-strategy#best-way-to-test-java-web-ui" class="hash-link" aria-label="Direct link to How do you test a Java web UI?" title="Direct link to How do you test a Java web UI?" translate="no">​</a></h3>
<p>Split the work by what each test can answer. Test rules with JUnit, test views with the TestBed, test client code with the Bun runner, and keep a short list of Playwright or Selenium tests for what only a real browser shows. Most checks stay fast, and the slow ones cover what only a browser can answer.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="unit-vs-e2e">Should I rely on unit tests or end-to-end tests?<a href="https://docs.webforj.com/blog/java-web-app-testing-strategy#unit-vs-e2e" class="hash-link" aria-label="Direct link to Should I rely on unit tests or end-to-end tests?" title="Direct link to Should I rely on unit tests or end-to-end tests?" translate="no">​</a></h3>
<p>Rely on both, in proportion, with the TestBed in between. Unit and TestBed tests should be the large majority because they're fast and point at the exact failure. End-to-end tests should be few, and each should protect a journey a user would notice breaking.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="browser-for-views">Do I need a browser to test a webforJ view?<a href="https://docs.webforj.com/blog/java-web-app-testing-strategy#browser-for-views" class="hash-link" aria-label="Direct link to Do I need a browser to test a webforJ view?" title="Direct link to Do I need a browser to test a webforJ view?" translate="no">​</a></h3>
<p>No. The TestBed runs a view inside a JUnit test, finds components the way a user picks them out, clicks and types, and checks the result. You need a browser only for styling, layout, and client behavior.</p><div></div>]]></content:encoded>
            <category>Tutorial</category>
        </item>
        <item>
            <title><![CDATA[Best Java framework for AI coding: why webforJ fits]]></title>
            <link>https://docs.webforj.com/blog/java-framework-for-ai-coding</link>
            <guid>https://docs.webforj.com/blog/java-framework-for-ai-coding</guid>
            <pubDate>Thu, 05 Nov 2026 15:00:00 GMT</pubDate>
            <description><![CDATA[webforJ is the best Java framework for AI coding. One language, typed APIs and an official MCP server and skills keep generated UI code correct and compiling.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" src="https://cdn.webforj.com/webforj-documentation/blogs/2026-11-05-java-framework-for-ai-coding/cover-v3.jpg" alt="cover image" class="img_ev3q"></p>
<p>Hand an AI assistant a Java web project and ask for a new screen. Whether you get working code or an afternoon of fixes depends less on the model than on the framework: how many languages the screen spans, how many ways there are to do the same thing, and whether the assistant can check the real APIs or has to remember them.</p>
<p>The best Java framework for AI coding is the one that leaves the assistant the least room to be wrong. In webforJ the whole UI is plain Java with typed components, so mistakes fail at compile time, and an official <a class="" href="https://docs.webforj.com/docs/ai-tooling">AI plugin</a> connects Claude Code, Copilot, Cursor, Gemini and Codex to the real webforJ docs and APIs.</p>
<div class="cta_UErl" role="complementary" aria-label="Using AI to build Java apps?"><div class="copy_XH8h"><p class="title_HfaR">Using AI to build Java apps?</p><p class="text_x4Wj">Ask the team about webforJ AI tooling: the MCP server, Agent Skills, and how they keep generated code correct.</p></div><div class="actions_9PxU"><a class="primary_idFC" href="https://webforj.com/schedule-discovery/" target="_blank" rel="noopener noreferrer">Book a call<!-- --> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg></a><a class="secondary_GDTR" href="mailto:sales@basis.cloud?subject=AI%20and%20webforJ&amp;body=Hi%20webforJ%20team%2C%0A%0A%0A%0A(I%20was%20reading%3A%20)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"></path></svg> <!-- -->Ask by email</a></div></div><h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-ai-tools-struggle">Why AI tools struggle with web UIs<a href="https://docs.webforj.com/blog/java-framework-for-ai-coding#why-ai-tools-struggle" class="hash-link" aria-label="Direct link to Why AI tools struggle with web UIs" title="Direct link to Why AI tools struggle with web UIs" translate="no">​</a></h2>
<p>Ask an assistant for a web screen and the answer usually spans several languages and layers. A template for the markup, a stylesheet, some JavaScript for behavior, a REST controller to feed it, and a client-side data layer to glue it together. Each layer has its own conventions and its own ways to fail quietly.</p>
<p>That is where generated code goes wrong. A model can produce a template that looks right and binds to a field that no longer exists. It can call an endpoint with a slightly wrong shape. None of this fails until someone runs the page, and the failure often shows up as a blank area instead of an error.</p>
<p>The more the framework relies on strings, conventions and runtime wiring, the more an assistant has to guess. Guessing is what language models do worst when the guess has to be exact. If you are still comparing options, see the <a class="" href="https://docs.webforj.com/blog/best-java-ui-frameworks">best Java UI framework for business apps</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ai-friendly-java-framework">What an AI-friendly framework needs<a href="https://docs.webforj.com/blog/java-framework-for-ai-coding#ai-friendly-java-framework" class="hash-link" aria-label="Direct link to What an AI-friendly framework needs" title="Direct link to What an AI-friendly framework needs" translate="no">​</a></h2>
<p>If you are choosing a Java framework for AI-generated code, four properties matter more than anything else:</p>
<ol>
<li class=""><strong>One language for the whole screen.</strong> No template dialect, no second syntax to keep in sync.</li>
<li class=""><strong>Typed APIs.</strong> A wrong method name or argument is a compiler error the assistant can read and fix, not a silent runtime surprise.</li>
<li class=""><strong>A small, consistent set of patterns.</strong> Fewer ways to do the same thing means fewer divergent answers.</li>
<li class=""><strong>Grounding.</strong> A way for the assistant to look up real signatures instead of recalling them.</li>
</ol>
<p>webforJ is built around the first three, and ships the fourth.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="java-all-the-way-down">Java all the way down<a href="https://docs.webforj.com/blog/java-framework-for-ai-coding#java-all-the-way-down" class="hash-link" aria-label="Direct link to Java all the way down" title="Direct link to Java all the way down" translate="no">​</a></h2>
<p>In webforJ you compose the UI imperatively in Java. There is no JSX and no HTML template to keep in step with your code. A view is a class, components are objects, and events are lambdas. This is the hello world view from the <a class="" href="https://docs.webforj.com/docs/introduction/basics">webforJ basics</a> page:</p>
<div class="language-java codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-java codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token annotation punctuation" style="color:var(--dwc-code-punctuation)">@Route</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"/"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">class</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">HelloWorldView</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">extends</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Composite</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&lt;</span><span class="token generics class-name" style="color:var(--dwc-code-class)">FlexLayout</span><span class="token generics punctuation" style="color:var(--dwc-code-punctuation)">&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">final</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">FlexLayout</span><span class="token plain"> self </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token function" style="color:var(--dwc-code-function)">getBoundComponent</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token plain"> hello </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">TextField</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"What is your name?"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">private</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token plain"> btn </span><span class="token operator" style="color:var(--dwc-code-operator)">=</span><span class="token plain"> </span><span class="token keyword" style="color:var(--dwc-code-keyword)">new</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Button</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Say Hello"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token keyword" style="color:var(--dwc-code-keyword)">public</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">HelloWorldView</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    self</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setDirection</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">FlexDirection</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token constant" style="color:var(--dwc-code-number)">COLUMN</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    self</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setMaxWidth</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token number" style="color:var(--dwc-code-number)">300</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    self</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setStyle</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"margin"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"1em auto"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    btn</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">setTheme</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token class-name" style="color:var(--dwc-code-class)">ButtonTheme</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token constant" style="color:var(--dwc-code-number)">PRIMARY</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">        </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">addClickListener</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">e </span><span class="token operator" style="color:var(--dwc-code-operator)">-&gt;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">          </span><span class="token class-name" style="color:var(--dwc-code-class)">Toast</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">show</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token string" style="color:var(--dwc-code-string)">"Welcome to webforJ Starter "</span><span class="token plain"> </span><span class="token operator" style="color:var(--dwc-code-operator)">+</span><span class="token plain"> hello</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">getValue</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token plain"> </span><span class="token operator" style="color:var(--dwc-code-operator)">+</span><span class="token plain"> </span><span class="token string" style="color:var(--dwc-code-string)">"!"</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> </span><span class="token class-name" style="color:var(--dwc-code-class)">Theme</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token constant" style="color:var(--dwc-code-number)">GRAY</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">    self</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">.</span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">(</span><span class="token plain">hello</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">,</span><span class="token plain"> btn</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">)</span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">  </span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain"></span><span class="token punctuation" style="color:var(--dwc-code-punctuation)">}</span><br></div></code></pre></div></div>
<p>For an assistant this is the easy case. The layout, the state and the behavior sit in one file, in plain Java. If it invents <code>btn.onPress(...)</code>, <code>javac</code> says so immediately, and the assistant fixes it in the next turn without you reading a stack trace.</p>
<p>The server-side model helps too. The app runs on the server and webforJ handles the client traffic, so the code the assistant writes is ordinary Java calling ordinary Java methods. It does not have to design a REST contract between a front end and a back end just to show a table. If that idea is new to you, our post on the <a class="" href="https://docs.webforj.com/blog/java-full-stack-framework">Java full stack framework</a> walks through it.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="few-patterns">Few patterns, so fewer wrong answers<a href="https://docs.webforj.com/blog/java-framework-for-ai-coding#few-patterns" class="hash-link" aria-label="Direct link to Few patterns, so fewer wrong answers" title="Direct link to Few patterns, so fewer wrong answers" translate="no">​</a></h2>
<p>Consistency matters as much as typing. Most webforJ component classes are <code>final</code>, and the framework steers you toward <a class="" href="https://docs.webforj.com/docs/architecture/controls-components">composites</a> instead of subclassing. Every custom piece of UI is built the same way: a class that wraps other components.</p>
<p>That sounds like a restriction for humans, but it is a gift to a model. There is one answer to "how do I make a reusable address card" and not four inheritance variants that behave differently. The code an assistant generates for your app looks like the code it generated last week, and like the code your team writes by hand. Code review gets easier for the same reason, because every reviewer already knows the shape of a webforJ view.</p>
<p>It also keeps prompts short. You do not need to explain a house style for components, because the framework already enforces one.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="mcp-and-skills">Grounding with the MCP server and skills<a href="https://docs.webforj.com/blog/java-framework-for-ai-coding#mcp-and-skills" class="hash-link" aria-label="Direct link to Grounding with the MCP server and skills" title="Direct link to Grounding with the MCP server and skills" translate="no">​</a></h2>
<p>Types catch wrong code. Grounding prevents it. The <a class="" href="https://docs.webforj.com/docs/ai-tooling/mcp">webforJ MCP server</a> lets an assistant:</p>
<ul>
<li class="">search the webforJ docs and API instead of hallucinating method names</li>
<li class="">scaffold new projects from the official Maven archetypes</li>
<li class="">generate DWC themes from a brand color</li>
<li class="">read the styling surface of a component and validate any <code>--dwc-*</code> token before it reaches your CSS</li>
</ul>
<p>On top of that, <a class="" href="https://docs.webforj.com/docs/ai-tooling/agent-skills">Agent Skills</a> give the assistant a playbook for the task in front of it. The server answers questions, and the skills say when to ask them, which pattern fits and how to check the result. Skills ship for building forms, creating components, styling, securing routes, localization, timers and async work, servlets, and version upgrades.</p>
<p>The <a class="" href="https://docs.webforj.com/docs/ai-tooling">webforJ AI plugin</a> installs both in one step. For Claude Code it is two commands:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:var(--dwc-code-text);--prism-background-color:var(--dwc-code-bg)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:var(--dwc-code-text);background-color:var(--dwc-code-bg)"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">claude plugin marketplace </span><span class="token function" style="color:var(--dwc-code-function)">add</span><span class="token plain"> webforj/webforj-ai</span><br></div><div class="token-line" style="color:var(--dwc-code-text)"><span class="token plain">claude plugin </span><span class="token function" style="color:var(--dwc-code-function)">install</span><span class="token plain"> webforj@webforj-ai</span><br></div></code></pre></div></div>
<p>Copilot CLI, VS Code with Copilot, Gemini CLI and Codex CLI have their own install steps on the same page, and Cursor and other Agent Skills clients can be configured manually. We first covered the MCP server in <a class="" href="https://docs.webforj.com/blog/mcp">webforJ, meet Claude</a>.</p>
<p>One habit helps: mention <strong>webforJ</strong> in your prompt. That is the cue the assistant uses to reach for the plugin instead of general Java knowledge.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-it-compares">Best Java framework for AI coding<a href="https://docs.webforj.com/blog/java-framework-for-ai-coding#how-it-compares" class="hash-link" aria-label="Direct link to Best Java framework for AI coding" title="Direct link to Best Java framework for AI coding" translate="no">​</a></h2>
<div class="table-wrapper"><div class="table-container" style="overflow-x:auto"><table><thead><tr><th>What the assistant needs</th><th>Typical multi-layer web stack</th><th>webforJ</th></tr></thead><tbody><tr><td>Languages per screen</td><td>Several (markup, style, script, Java)</td><td>Java</td></tr><tr><td>Wrong API call</td><td>Often found at runtime</td><td>Compiler error</td></tr><tr><td>Docs access</td><td>Training data or generic web search</td><td>Official MCP server</td></tr><tr><td>Task playbooks</td><td>None, or written by you</td><td>Agent Skills for common tasks</td></tr><tr><td>Ways to build a reusable component</td><td>Many</td><td>Composites</td></tr></tbody></table></div><style data-emotion="css 1k371a6">@media print{.css-1k371a6{position:absolute!important;}}</style></div>
<p>The pattern behind the table is simple. Every row is a place where a model would otherwise guess, and webforJ replaces the guess with a compiler check, a lookup, or a single agreed pattern. That is the case for webforJ as the Java framework to hand to an assistant.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="next-step">Try it on a small screen<a href="https://docs.webforj.com/blog/java-framework-for-ai-coding#next-step" class="hash-link" aria-label="Direct link to Try it on a small screen" title="Direct link to Try it on a small screen" translate="no">​</a></h2>
<p>Scaffold a project at <a href="https://docs.webforj.com/startforj" target="_blank" rel="noopener noreferrer" class="">startforJ</a>, install the plugin, and ask your assistant for a form with a few fields and a button, mentioning webforJ in the prompt. The <a class="" href="https://docs.webforj.com/docs/introduction/getting-started">getting started guide</a> covers running the result.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="faq">Frequently asked questions<a href="https://docs.webforj.com/blog/java-framework-for-ai-coding#faq" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="which-java-ui-framework-works-with-an-llm">Which Java UI framework works with an LLM?<a href="https://docs.webforj.com/blog/java-framework-for-ai-coding#which-java-ui-framework-works-with-an-llm" class="hash-link" aria-label="Direct link to Which Java UI framework works with an LLM?" title="Direct link to Which Java UI framework works with an LLM?" translate="no">​</a></h3>
<p>Any of them can be driven by an assistant, but webforJ is the one with first-party tooling for it. The plugin works with Claude Code, GitHub Copilot, Cursor, Gemini CLI and Codex, and it connects them to the webforJ docs, scaffolding, and styling tools.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="is-webforj-ai-friendly-without-the-plugin">Is webforJ AI-friendly without the plugin?<a href="https://docs.webforj.com/blog/java-framework-for-ai-coding#is-webforj-ai-friendly-without-the-plugin" class="hash-link" aria-label="Direct link to Is webforJ AI-friendly without the plugin?" title="Direct link to Is webforJ AI-friendly without the plugin?" translate="no">​</a></h3>
<p>Yes, in the sense that matters most. The UI is Java, the APIs are typed and the patterns are consistent, so generated code is checked by the compiler. The plugin adds lookup and workflows on top, which improves accuracy further.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="can-ai-generated-code-be-trusted">Can AI-generated webforJ code be trusted in production?<a href="https://docs.webforj.com/blog/java-framework-for-ai-coding#can-ai-generated-code-be-trusted" class="hash-link" aria-label="Direct link to Can AI-generated webforJ code be trusted in production?" title="Direct link to Can AI-generated webforJ code be trusted in production?" translate="no">​</a></h3>
<p>Treat it like any code from a new teammate. Compile it, run it, and review it. The compiler catches wrong calls, and the MCP server reduces them in the first place, but you should still test generated code before shipping.</p><div></div>]]></content:encoded>
            <category>AI</category>
            <category>MCP</category>
        </item>
    </channel>
</rss>