Java Spring Framework 4.0 示例应用程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20934985/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 05:24:55  来源:igfitidea点击:

Spring Framework 4.0 Sample application

javaspringhibernatespring-4

提问by Thom

I haven't kept up with all of the changes to the spring framework since 2.5. I am looking for a sample application for 4.0 that has a basic skeleton app with hibernate done the 4.0 way with controllers and services.

自 2.5 以来,我没有跟上 Spring 框架的所有更改。我正在寻找一个 4.0 的示例应用程序,它有一个基本的框架应用程序,带有 hibernate,用控制器和服务以 4.0 的方式完成。

I've googled and looked at the spring site, which I think has been made much worse in the last year or so. Can anyone help me out?

我用谷歌搜索并查看了 spring 站点,我认为它在过去一年左右变得更糟。谁能帮我吗?

采纳答案by MariuszS

Spring Guides

弹簧指南

Take look at Spring Guides, all with Spring 4.0.

看看Spring Guides,所有这些都包含 Spring 4.0。

(..) these guides are designed to get you productive as quickly as possible – using the latest Springproject releases and techniques as recommended by the Spring team.

(..) 这些指南旨在让您尽快提高工作效率——使用Spring 团队推荐的最新Spring项目版本和技术。

I think tutorial Data Access with Springcan help you, especially step 3:

我认为使用 Spring进行数据访问教程可以帮助您,尤其是第 3 步:

with source code: https://github.com/spring-guides/tut-data

附源代码:https: //github.com/spring-guides/tut-data

There is also Getting Started Guide, designed to be completed in 15-30 minutes

还有入门指南,旨在在 15-30 分钟内完成

with source code: https://github.com/spring-guides/gs-accessing-data-jpa.

源代码:https: //github.com/spring-guides/gs-accessing-data-jpa

This give you general look at possibilites. You can use solutions from this (like Spring Data JPAetc) with or without Spring Boot.

这使您可以大致了解可能性。您可以在有或没有Spring Boot 的情况下使用此解决方案(如Spring Data JPA等)。

Appfuse archetypes

Appfuse 原型

There is also Appfuse 3.0recently released with support for Spring 4.0.

还有的AppFuse 3.0最近发布的支持对Spring 4.0。

AppFuse is a full-stack framework for building web applications on the JVM. It was originally developed to eliminate the ramp-up time when building new web applications. Over the years, it has matured into a very testable and secure system for creating Java-based webapps.

AppFuse 是一个全栈框架,用于在 JVM 上构建 Web 应用程序。它最初是为了消除构建新 Web 应用程序时的启动时间而开发的。多年来,它已经成熟为一个非常可测试且安全的系统,用于创建基于 Java 的 web 应用程序。

AppFuse is full of good patterns, simply build new project from appfuse archetypeand take look.

AppFuse 充满了很好的模式,只需从appfuse 原型构建新项目并查看。

回答by Yanis

There is also an interesting project that helps you to bootstrap your spring app as easy and fast as possible. You probably would like to take a look. Spring Boot

还有一个有趣的项目可以帮助您尽可能轻松快速地引导您的 spring 应用程序。你可能想看看。弹簧靴

回答by Keyur

If you are looking for normal application (not a web application but integration of Spring 4 with hibernate 4) then you can refer to My Blog. If you are interested in further integrate the same to Spring MVC you need to create controller class with annotation @Controller and autowire the same to respective Service class via @Service annotation.

如果您正在寻找普通应用程序(不是 Web 应用程序,而是 Spring 4 与 hibernate 4 的集成),那么您可以参考我的博客。如果您有兴趣将其进一步集成到 Spring MVC,您需要创建带有 @Controller 注释的控制器类,并通过 @Service 注释将其自动装配到相应的 Service 类。

回答by Krishna

Spring 4 comes with lot of new features. One of them is the support for Java 8 version. Here is the list of notable features included in the Spring 4 release.

Spring 4 带来了许多新功能。其中之一是对 Java 8 版本的支持。以下是 Spring 4 版本中包含的显着特性列表。

  1. Spring MVC Test Framework
  2. Asynchronous MVC processing on Servlet 3.0
  3. custom @Bean definition annotations in @Configuration classes
  4. @Autowired and @Value to be used as meta-annotations
  5. Concurrency refinements across the framework
  6. loading WebApplicationContexts in the TestContext framework
  7. JCache 0.5 (JSR-107)
  1. Spring MVC 测试框架
  2. Servlet 3.0 上的异步 MVC 处理
  3. @Configuration 类中的自定义 @Bean 定义注释
  4. @Autowired 和 @Value 用作元注释
  5. 跨框架的并发改进
  6. 在 TestContext 框架中加载 WebApplicationContexts
  7. JCache 0.5 (JSR-107)

Also you can read the list of Spring 4 Tutorials.

您也可以阅读Spring 4 教程列表。