使用纯Java Servlets(不使用Spring/CDI)创建一个新的Vaadin Flow 16/17项目。

huangapple go评论107阅读模式
英文:

Create a new Vaadin Flow 16/17 project using plain Java Servlets without Spring/CDI

问题

starter page 上的 Vaadin Flow 已经发生了变化。那个页面现在只为 Spring Boot 配置了新项目。此页面的旧版本提供了“普通 Java Servlet”的选项,以及 Spring/CDI

Vaadin 文档建议手动使用 Maven 原型。但是 com.vaadin… 的 Maven 仓库似乎针对 Vaadin 8 及更早版本,没有针对 Vaadin 10 及更高版本的。

学习 Maven 的 Vaadin 页面 展示了一个使用 viritin-vaadin-flow-archetype 作为原型的示例。但是 Viritin 是一个第三方项目,会添加我目前不需要的库。

➥ 是否有途径可以仅使用普通的 Java Servlets 来启动一个在 Jetty 或 Tomcat 上运行的新 Vaadin 16 项目,而不使用 Spring/CDI?(或 Vaadin 17 预发布)

或者 Vaadin 公司是否决定现在仅支持 Spring?(那将是非常不幸的。)

英文:

The starter page for Vaadin Flow has changed. That page now offers new projects configured only for Spring Boot. The previous version of this page offered an option for "Plain Java Servlet" as well as Spring/CDI.

The Vaadin documentation suggests using a Maven archetype manually. But the Maven repositories for com.vaadin… appear to be aimed at Vaadin 8 and earlier, with none for Vaadin 10 and later.

The Vaadin page on learning Maven shows an example using viritin-vaadin-flow-archetype as an archetype. But Viritin is a third-party project, and would add libraries I do not presently need.

➥ Is there an avenue to start a new Vaadin 16 project using only plain Java Servlets to be run on Jetty or Tomcat without Spring/CDI? (or Vaadin 17 pre-release)

Or has the Vaadin Ltd company decided to support only Spring now? (That would be most unfortunate.)

答案1

得分: 3

至少Maven原型vaadin-archetype-application在v16版本之前似乎是可用的:

mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=LATEST

我应该更新那个教程... 感谢你提供的提示。

英文:

At least the Maven archetype vaadin-archetype-application seems to be working for versions up to v16:

mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=LATEST

I should update that tutorial... thanks for the hint on this.

答案2

得分: 0

Hello World Starters 页面

请访问 Vaadin.com 网站上的 Hello World Starters 页面。在那里,您将找到几个入门项目。其中一些涉及 Spring,而另一些则不涉及。

不涉及 Spring 的项目包括:

  • Vaadin – 纯 Java(仅 Servlet,无 Spring,无 CDI,使用 Maven 构建)
  • Vaadin – CDI
  • Vaadin – Quarkus
  • Vaadin – Gradle

您会在多个 Vaadin 版本中找到这些项目。

某些 Vaadin 版本还支持:

  • Vaadin – OSGi
  • Vaadin – Karaf

使用纯Java Servlets(不使用Spring/CDI)创建一个新的Vaadin Flow 16/17项目。

英文:

Hello World Starters page

See the Hello World Starters page on the Vaadin.com site. There you will find several starter projects. Some involve Spring, and some do not.

Those without Spring include:

  • Vaadin – Plain Java (just Servlet, no Spring, no CDI, built by Maven)
  • Vaadin – CDI
  • Vaadin – Quarkus
  • Vaadin – Gradle

You will find those across multiple versions of Vaadin.

Some versions of Vaadin also support:

  • Vaadin – OSGi
  • Vaadin – Karaf

使用纯Java Servlets(不使用Spring/CDI)创建一个新的Vaadin Flow 16/17项目。

huangapple
  • 本文由 发表于 2020年8月20日 06:57:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/63496047.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定