TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Why isn't GWT or Vaadin more popular among Java developers?

52 点作者 oldjavacoder将近 3 年前
When I think about TypeScript and Angular I break out in a cold sweat. When I remember creating UI's in GWT and it just worked, in Java, it brings back fond memories. So I'm relegated to the backend. Any other Java devs out there who'd like to to more in the front end but in Java, the language we know and love?

36 条评论

16bytes将近 3 年前
I can&#x27;t speak to Vaadin, but adopting GWT was a huge mistake at my old company. We bought into the promise that you didn&#x27;t need front-end developers or retrain on front-end tech, you can just use Java that you know and love!<p>As it turns out, if you want to create a great front-end, you need to know javascript &amp; css. You need to understand the difference between what is running on the client and what runs on the server. Corner cases which are super easy to fix with web-tooling turn into an impossible slog of trying to figure out how to get GWT do what you want it to do.<p>GWT interfaces are famously brittle ugly huge monoliths that send a million AJAX requests that are almost impossible to debug or optimize. There are no separations of concern. There&#x27;s no defined &quot;API&quot;.<p>It&#x27;s like having nobody on your team know SQL and only ever use an ORM. At some point you need to break the layer of abstraction.
评论 #32070604 未加载
评论 #32070618 未加载
评论 #32070766 未加载
评论 #32070145 未加载
评论 #32092111 未加载
gwbas1c将近 3 年前
I did a few learning projects in GWT when it was new, in 2007. It was <i>truly groundbreaking.</i><p>Fast forward to 2022 and GWT is <i>completely obsolete.</i> Today, systems like this compile to WASM. (IE, C# in the browser is done with WASM.) Furthermore, manipulating the DOM in code, as done in GWT, is extremely tedious and time-consuming compared to template-based approaches. GWT&#x27;s live debugging leaves a lot to be desired.<p>Finally: Google abandoned GWT development. When I looked at its site in 2020, it looked like a hobby project; or something maintained by a small group of developers who still had projects using it.<p>Honestly: Don&#x27;t be afraid to try a new language! In-browser development with C# (via Blazor) is really awesome, and coming from Java, it&#x27;ll be an easy transition. (And it really is much, much better than GWT.)
评论 #32072899 未加载
评论 #32071070 未加载
jmartrican将近 3 年前
I ask the same question. I use Vaadin extensively. What I really love about it is that I am able to code my frontend apps just like my backend microservices apps... e.g. with Spring Boot. You can really leverage the years of experience in Java backend on your frontend.<p>So far I have not ran into a problem I could not fix yet. Vaadin does have a learning curve. After using it for a while, I find myself wanting to use my own components, versus the many components Vaadin provides out of the box.<p>Vaadin has support for PWA for single site apps. For multiple site apps, I had to create my own solution that relied heavily on Servlet Filters to dynamically return the PWA files.<p>Vaadin has a really cool testing library. It makes it really easy for me to do TDD on my frontend code. TDD is a MUST. So I quickly create a breaking test using the Vaadin testing framework... which uses Selenium underneath the hood. Using Selenium is huge cause I can get answers to my questions about testing by searching for the Selenium answer that I can apply in my tests.<p>Vaadin also supports PUSH technology out of the box. Its super easy to use. I use it extensively to have my web pages op up quickly, then slowly get filled out as the APIs return. No need to mention how awesome PUSH technology is. Though you need to be good at multi-threaded coding.<p>FYI, I don&#x27;t work for Vaadin. Plus I am also a REACT programmer. I love REACT and find it very elegant. I shed a tear first time I used REACT. I think REACT and Vaadin are similar for me (in the sense that I can get a lot of high quality work done quickly). For personal projects I will always use Vaadin. For paying clients, they typically request REACT.... lol.
评论 #32069789 未加载
tannhaeuser将近 3 年前
FYI, GWT lives on as J2CL and is integrated with closure-compiler. Only the front end lib that was GWT is gone - arguably what people used it for though. AFAIK J2CL is still heavily used for gmail and gdocs ie those projects haven&#x27;t been rewritten from scratch. J2CL sees less use than GWT used to since there are alternatives today for typed large-scale browser app development (such as ts), and also because J2CL is wrapped in Bazel build scripting, though J2CL and closure-compiler can be used from regular Java build tools or the command line as well via plain &quot;java -jar ...&quot; invocation.<p>Technically, J2CL&#x2F;closure-compiler, and the level of optimization and minification it can provide is unmatched by the likes of TS et al last I checked. Why one would use Vaadin (or Echo before) is a mystery to me though - these latter tools are putting too much weight into Java the language&#x2F;ecosystem, for Java traditionalist developers who can&#x27;t be bothered to learn something else IMO.
评论 #32074085 未加载
ecshafer将近 3 年前
I think the biggest reason is that they are really bad frameworks. GWT isn&#x27;t really supported anymore, but for a while it was a creative way to build UI in a world where Javascript frameworks weren&#x27;t that advanced. You might not like Angular, but React, Vue, Ember, Meteor, and many many others exist. If you want types and don&#x27;t like the JS style, you can use Typescript.<p>I have used GWT, I wouldn&#x27;t use it again. I tried Vaadin, and it was so terrible I would never touch it again.<p>&gt;So I&#x27;m relegated to the backend.<p>You are not relegated to backend. You can always learn JS Framework stuff. You shouldn&#x27;t pigeonhole yourself into one area. Many many many developers do both.
评论 #32069870 未加载
Rezwoodly将近 3 年前
Just because it makes you break out in a cold sweat doesn&#x27;t necessarily map to others. I can work comfortably on both ends of the stack. I despise gwt and vaadin. Why would I want to pick an inferior technology because someone has an inability to program in a different syntax or spend a few weeks on the job learning about a new framework. Jesus.
评论 #32075873 未加载
recursivedoubts将近 3 年前
i have an alternative suggestion (of course I do):<p><a href="https:&#x2F;&#x2F;htmx.org" rel="nofollow">https:&#x2F;&#x2F;htmx.org</a><p>rather than trying to build web front ends in a language-specific builder syntax server side and dealing w&#x2F;the impedance mismatch between your language of choice and the actual realities on the ground in HTML, you use a more powerful hypertext instead<p>this lets you accomplish more in HTML, but also moves a lot of logic back to the back-end, so you are able to spend more time in your preferred language and framework<p>its an alternative approach to spending more time in your preferred language, it is just a hop skip and a jump beyond the normal HTML everyone knows anyway, and it transfers to any back-end that can produce HTML&#x2F;hypermedia (nearly all of them)<p>&lt;&#x2F;shill&gt;
评论 #32070324 未加载
jeffreportmill1将近 3 年前
I use SnapKit to do Java desktop development which compiles easily to JavaScript using TeaVM. SnapKit is both modern and conventional, a good middle ground between Swing and JavaFX. But most importantly, it combines the traditional win of desktop Java UI dev with the ease of web deployment.<p>SnapKit: <a href="https:&#x2F;&#x2F;github.com&#x2F;reportmill&#x2F;SnapKit" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;reportmill&#x2F;SnapKit</a><p>Demos: <a href="https:&#x2F;&#x2F;reportmill.com&#x2F;snaptea&#x2F;" rel="nofollow">https:&#x2F;&#x2F;reportmill.com&#x2F;snaptea&#x2F;</a><p>Disclaimer: I am the primary author, so this is self-serving. But it doesn&#x27;t mean it sucks. :-)
评论 #32078023 未加载
评论 #32087083 未加载
评论 #32071720 未加载
invalidname将近 3 年前
We built our startups web UI on GWT. It was super easy to get started and we had a decent looking UI in no time. Then newer JS frameworks came along and our site looked obsolete and crappy by comparison (I&#x27;m talking circa 2014-15 or so). We started looking at making the GWT code look good visually.<p>The pain was too big, styling this thing vs. just using ready made JS and HTML to create a simple UI. We eventually dumped GWT which was easier than going through the pain of adapting the UI. It seemed the community was dead and Google abandoned this long ago. Vaadin seemed nice but overly focused on the server aspect which we didn&#x27;t feel we needed. Even they moved off of GWT eventually.<p>Today we still use TeaVM as part of Codename One itself to create web UIs. It works great and since we have the UI aspect working its good. But this works more like a Flash applet and isn&#x27;t meant to be a website or typical web app.
评论 #32078040 未加载
oneplane将近 3 年前
Mostly because today, a Java application is either a back-end application or a dead-end project. Everything a user touches is either native or web, and you can&#x27;t get proper UX if you skip steps and try to magically render a useful UI as a non-UI developer.<p>It used to be much more acceptable to have &quot;any&quot; UI, but today, if you can&#x27;t make a generic bootstrap, tailwind or react based UI, you might as well stop and hand that task over to someone else.<p>Dojo (the JavaScript framework) and ExtJs essentially died the same death (yes, there are still UIs based on those, and the instantly feel like 2006) because of the same reasons, while being completely web-targeted; they tried to make a Swing&#x2F;AWT&#x2F;WinForms type of application design a &quot;thing&quot; for the web, which didn&#x27;t really work out long-term. It was great while it lasted.
评论 #32072133 未加载
评论 #32078004 未加载
gordaco将近 3 年前
I miss GWT. Glad to see I&#x27;m not the only one. Then again I don&#x27;t like web programming at all and I&#x27;d rather write a desktop UI, which explains it, I guess.<p>I miss the times when UI didn&#x27;t necessarily mean web. I guess I&#x27;m obsolete.
MockObject将近 3 年前
I started a GWT project last winter, but abandoned GWT and replaced it with Bootstrap + JS, because<p>* There was an odd bug I had no clue about, where the top 2&#x2F;3 of the page was unclickable, until I added enough elements on the page to cause scrolling<p>* Ugly layout, which the docs advised me to fix using CSS, which was exactly the approach I was trying to avoid<p>* No native support for server push, like websockets<p>* Pinned to Java 8<p>* Innate layout issues, like the clipping of panel edges
throwawaymap将近 3 年前
GWT was great for boring tech stories back in the day. It was briefly alluded to in one of the comment I think but, at least to me, GWT&#x27;s killer feature was porting big legacy battle-tested core GUI SDKs to HTML5 compliant browsers.<p>e.g., circa 2010, we were porting 50k+ LOC mapping&#x2F;GIS libraries to the browser and it worked way better than we thought it would. This was a unit tested codebases that were being used for at least 5 years on the desktop. We were also able to get touch gestures working decently on it.<p>To second another comment, these days WASM would make more sense, but back in the day customers would be taken aback when were able to provide niche mapping features they were used to seeing on the desktop pop up on the browser.
javajosh将近 3 年前
The biggest reason IMHO is that it was yet another GUI toolkit unrelated to Swing. It might have done better if it was more Swing-ish.<p>This may be common knowledge, but I want to point out that Java&#x27;s biggest problem was and remains distributing the runtime. And it&#x27;s on this basis alone that JavaScript has won. Swing is a good toolkit - Swing is still used by Netbeans and IntelliJ, and a handful of other popular tools. Both of those tools have good round-tripping interactive form builders. It&#x27;s a lot of value, but yeah, distribution is so bad you can&#x27;t realistically access that value. (Compiling to native with Graal is an interesting option.)
jojule将近 3 年前
Check out Vaadin Flow framework. Modern single page web app in 100% in Java. Everything just works. And looks beautiful by default.
评论 #32078097 未加载
gedy将近 3 年前
I used to love Java and was very into server side UI frameworks like these and Wicket.<p>Issue was though UIs started becoming a lot more stateful, and trying to manage complex state on server and synced to client brings a ton of complexity and scalability issues. (Memory was tough to manage with wicket, etc) Browsers and JS engines became way more powerful too and it just made a lot more sense starting about 10 years ago to do more UI on client.<p>If you actually enjoy UI development, the modern JS options are way better than the alternatives and you should try them out.<p>(I&#x27;m talking applications, not old school websites with no state between views)
zactato将近 3 年前
You&#x27;re relegated to the backend not because you know Java instead of Typecript, but because you don&#x27;t understand the problems of frontend development.<p>Thinking about how a user interacts with a page, how asynchronous data loads, different screen sizes, how to handle intermittent connections are very different problems than most backend developers deal with. They are all very complex topics that have been evolving over the last 15 years. Modern frontend frameworks focus on addressing these complexities. Because JS&#x2F;TS are the language of the frontend, the best frontend frameworks are written in these.
评论 #32070276 未加载
评论 #32078076 未加载
bootcat将近 3 年前
I don&#x27;t know why but I do feel there is a gap here to empower backend developers to take over the full stack. ( I am one of the developers looking out for a good maintained, component rich, completely supported JVM java based FE framework )<p>One of my reasons not to pick Vaadin was that it was backed by a company rather than a open source community. ( this seems better now in terms of support )<p>I do see other JVM languages like Kotlin seeing some success here.<p>Did you guys see dart and flutter ? I am pretty sure Java can do a comeback in terms of compiling to JS and taking the power from react&#x2F;typescript guys !
评论 #32078136 未加载
TeaVMFan将近 3 年前
TeaVM is faster and more web-centric than either of the mentioned options:<p><a href="https:&#x2F;&#x2F;blogs.oracle.com&#x2F;javamagazine&#x2F;post&#x2F;java-in-the-browser-with-teavm" rel="nofollow">https:&#x2F;&#x2F;blogs.oracle.com&#x2F;javamagazine&#x2F;post&#x2F;java-in-the-brows...</a><p>* Super fast builds<p>* Complete Maven builds, no JS build nightmares<p>* Minifying, obfuscating<p>* Full, fast, HTML&#x2F;CSS-based component framework.<p>* Works with any JVM language, not just Java<p>See a TeaVM-based game, Wordii: <a href="https:&#x2F;&#x2F;frequal.com&#x2F;wordii&#x2F;" rel="nofollow">https:&#x2F;&#x2F;frequal.com&#x2F;wordii&#x2F;</a>
评论 #32078050 未加载
notwhatyouthink将近 3 年前
Had a peer the other day tell me he wanted to use Microsoft Blazor on a new project. I didn&#x27;t know what that was so I did some research. After some research I finally determined that it was basically some kind of frankenstein between Vaadin and GWT for C# developers. My first thought was yep we tried this before with Java.
评论 #32070588 未加载
testbjjl将近 3 年前
I used Vaadin a couple of years back converting a flash based app. Getting plug-ins to work was not fun, at all. Using JavaScript yourself&#x2F;directly is much easier. Now I write Java and Typescript and have even more fun writing the right code for the problem while increasing my value&#x2F;compensation.
评论 #32087267 未加载
darkcha0s将近 3 年前
The is little intersection between people who do frontend development and people who are comfortable at that level with Java.<p>Considering the tooling for almost any frontend framework is leaps and bounds ahead any of those two frameworks, it&#x27;s a no brainer why no one uses it, in my opinion.
评论 #32078127 未加载
Traubenfuchs将近 3 年前
Funny, I pretty much consider Angular with TS the frontend version of Java with Spring.<p>I love working with both.
efxzsh将近 3 年前
Not Java, but close. With Kotlin, there is a version of Jetpack Compose (Android UI framework) ported for the Web. It&#x27;s still experimental. Produced size is a bit too much (because of Kotlin&#x2F;JS not being super optimized yet).<p><a href="https:&#x2F;&#x2F;compose-web.ui.pages.jetbrains.team" rel="nofollow">https:&#x2F;&#x2F;compose-web.ui.pages.jetbrains.team</a><p>Vaadin has been around for a while now. I don&#x27;t know how people feel about it. There is still some room for them on the market. It&#x27;s &quot;just&quot; a backend service (Spring&#x2F;VertX&#x2F;etc) + a UI library (Vaadin&#x27;s one&#x2F;etc). It could look like Next.js but for JVM languages.<p>Just thinking out loud.
评论 #32076861 未加载
smrtinsert将近 3 年前
I remember JSF being big around the same time and working well enough (especially a4j ajax for jsf) so I think people preferred that as an interface since it was more similar to what they already knew, jsp.
MrBuddyCasino将近 3 年前
We use Vaadin for admin frontends in Spring Boot backend services written in Kotlin - this way the BE team can build admin UIs without frontend dev involvement. For that, it works ok.<p>Everything user-facing is React.
labrador将近 3 年前
Google came up with Dart so they could move away from GWT and now use Dart extensively internal to the company. Why would I want to use GWT and not Dart?
评论 #32073067 未加载
smrtinsert将近 3 年前
I&#x27;m really interested in <a href="https:&#x2F;&#x2F;hilla.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hilla.dev&#x2F;</a> these days but I doubt any company I&#x27;ll work at will use it as everyone seems to be react focused. I remember the hilla devs saying they were going to work on it compiling to wasm.
maldev将近 3 年前
As others have said, GWT was really groundbreaking, but it ended up making codebases turn to mush really fast. I would look into Blazor if I were you. It lets you use C# with javascript to make not only webapps, but apps on pretty much any platform with no tweaks. It&#x27;s pretty much GWT done right.
评论 #32078152 未加载
smallerfish将近 3 年前
I think GWT lost the plot when they moved to browser based debugging (the initial version supported IDE debugging of frontend code, which was awesome.)<p>Kotlin.js is getting pretty close to the ideal. Look into KVision, which is a framework on top of Kotlin.js, which is pretty ergonomic.
api将近 3 年前
Tried it once. It was clunky but interesting for its time. The big draw was to get away from JavaScript, but today you can do that in better languages like Go or Rust using WASM or you can use TypeScript to get a JavaScript that doesn&#x27;t suck as bad.
评论 #32078183 未加载
PaulHoule将近 3 年前
When GWT came out it was a rather unique way to write widget-based applications that run in the browser. There wasn&#x27;t anything like Angular, React, Vue or Svelte. So competition is much fiercer than when it came out.
dangerboysteve将近 3 年前
there seems to be a good push for server side front end development in other languages like LiveView (Phoenix&#x2F;Elixir) , Livewire (PHP&#x2F;Laravel) and Stimulus Reflex (ruby). There are many more.
ihateolives将近 3 年前
There&#x27;s also <a href="https:&#x2F;&#x2F;j2html.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;j2html.com&#x2F;</a>. I&#x27;ve been wanting to try it.
skyzyx将近 3 年前
GWT can fuck right the fuck off.
KronisLV将近 3 年前
I think that creating UIs in Java is only doable (well) when you have appropriate design tools - so in theory even Swing or OpenJFX (<a href="https:&#x2F;&#x2F;openjfx.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;openjfx.io&#x2F;</a>) are okay.<p>But once you start creating web apps, it all kind of breaks down.<p>I&#x27;d say that Vaadin was one of the less painful attempts at getting that architecture to work: it was <i>only</i> hard to customize when you tried doing something lower level, especially table display with custom row&#x2F;column groups and how components look, as well as <i>only</i> had weird issues with reloading data often, like a progress bar during long processes and <i>only</i> certain parts of it broke when attempting version upgrades and it <i>only</i> was kind of slow when you needed to recompile the widget set and it <i>only</i> seemed to have some non-critical resource issues in some environments and it <i>only</i> sometimes failed in weird ways on the server.<p>Contrast that to PrimeFaces (which is based on JSF), the bane of my existence in legacy projects: complicated life cycle that generally causes bugs with dynamic pages and complex use cases, dynamic component ID generation but querying that only works sometimes properly (the whole naming container distinction), the need to bind front end state to back end fields, but also needing to expect lots of getter&#x2F;setter calls, especially when you also need to throw in serialization for objects that you&#x27;d like to connect to your dropdowns, which in practice will more often look like storing the IDs from another list of options (though even simple things can break, like your dialogs disappearing after AJAX if someone didn&#x27;t bind the visibility parameter), just generally a hard time creating custom components with their own back end behavior, especially when trying to reuse those in different contexts, problems if you ever need to mix JSF and JSP tags and even libraries like OmniFaces breaking on you, especially after updates. Honestly, I&#x27;m afraid that I don&#x27;t recall most of the particular details, but on a 5-10 year old project my experience with PrimeFaces could be summed up with one word: pain.<p>I&#x27;m not saying that you absolutely cannot write good applications with a server side rendered approach, even with the more complex state management solutions (e.g. what Vaadin or PrimeFaces&#x2F;JSF have), it&#x27;s just that in practice you might be biting off more than you can chew - because once you venture off the beaten path, you&#x27;ll find that the abstractions will leak their details and you&#x27;ll be dealing with things that would have been easy with JS&#x2F;TS&#x2F;CSS&#x2F;HTML becoming hard.<p>That said, Angular also feels a bit more complicated than it needs to be (though it does have a nice amount of functionality out of the box), personally I&#x27;d look more in the direction of React, or more recently, Vue (since it seems to do hooks a bit better than React), with simple RESTful API in the middle. That way, you have a clear separation between the front end and the back end, both remain testable and debuggable in separation, there&#x27;s no leaky abstractions to deal with (or at least the ones that are there are mostly well known and you also won&#x27;t kill your career by becoming a developer of a largely obsolete tech either).<p>Even with all of that, I might still look in the direction of Ruby on Rails, PHP with Laravel or even Java with Vaadin for when I need an admin panel and there are few design requirements to speak of - only functional ones for the most part.
评论 #32073133 未加载