简体   繁体   English

Spring Framework 4.0示例应用程序

[英]Spring Framework 4.0 Sample application

I haven't kept up with all of the changes to the spring framework since 2.5. 自2.5以来,我没有跟上spring框架的所有变化。 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. 我正在寻找一个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. 我用Google搜索并查看了弹簧网站,我认为在过去的一年左右,这个网站已经变得更糟了。 Can anyone help me out? 谁能帮我吗?

Spring Guides 弹簧指南

Take look at Spring Guides , all with Spring 4.0. 使用Spring 4.0,查看Spring Guides

(..) these guides are designed to get you productive as quickly as possible – using the latest Spring project releases and techniques as recommended by the Spring team . (..)这些指南旨在尽可能快地提高您的工作效率 - 使用Spring团队推荐的最新Spring项目版本和技术。

I think tutorial Data Access with Spring can 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 JPA etc) with or without Spring Boot . 您可以使用或不使用Spring Boot来使用此解决方案(如Spring Data JPA等)。

Appfuse archetypes Appfuse原型

There is also Appfuse 3.0 recently 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. AppFuse是一个用于在JVM上构建Web应用程序的全栈框架。 It was originally developed to eliminate the ramp-up time when building new web applications. 它最初是为了消除构建新Web应用程序时的加速时间而开发的。 Over the years, it has matured into a very testable and secure system for creating Java-based webapps. 多年来,它已经成熟为一个非常可测试和安全的系统,用于创建基于Java的Web应用程序。

AppFuse is full of good patterns, simply build new project from appfuse archetype and take look. AppFuse充满了良好的模式,只需从appfuse原型构建新项目并进行查看。

There is also an interesting project that helps you to bootstrap your spring app as easy and fast as possible. 还有一个有趣的项目可以帮助您尽可能简单快速地引导您的spring应用程序。 You probably would like to take a look. 你可能想看看。 Spring Boot 春季启动

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

Spring 4 comes with lot of new features. Spring 4带来了许多新功能。 One of them is the support for Java 8 version. 其中之一是对Java 8版本的支持。 Here is the list of notable features included in the Spring 4 release. 以下是Spring 4发行版中包含的重要功能列表。

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

Also you can read the list of Spring 4 Tutorials . 您还可以阅读Spring 4教程列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM