• Spring MVC RSS ATOM Content Negotiation Example

    In this tutorial we show a Spring MVC RSS ATOM Content Negotiation example. Using Content Negotiation we can serve different versions of a document (or resource) at the same URI. Depending on the HTTP Accept header, a path file extension in the URL, a specific request parameter we return a view accordingly or if none of the previous are presented, we fall back on a default view.

    2019-08-10[Java]

    阅读更多
  • Spring MVC Excel View Example

    In this tutorial we demonstrate how to create an Excel view using Spring MVC. By utilizing Spring MVC Content negotiation we can have multiple views of the same resource. This example shows how to create an excel view, either in .xls and .xlsx format. When working with large excel documents it is profitable to use the streaming xlsx view. The streaming view uses less memory and can improve performance of large excel documents.

    2019-08-10[Java]

    阅读更多
  • Spring MVC PDF View Example

    This tutorial demonstrates how to create a PDF view using Spring MVC and itext. Out of the box spring only supports the older com.lowagie:itext library. The newest com.itextpdf:itext library is not supported by default. But there is a work around, which we’ll show you in the following example.

    2019-08-10[Java]

    阅读更多
  • Spring MVC RESTFul Web Service CRUD Example

    In this tutorial we show you how to build a RESTFul Web Service using Spring MVC 4. We create a controller that’ll manage CRUD operations like Create, Read, Update and Delete using the correct HTTP request methods POST, GET, PUT and DELETE respectively. This rest service consumes and produces JSON – JavaScript Object Notation. We enable Cross-origin Resource Sharing by implementing a custom filter to set the correct headers. To evaluate the rest service, we are using a chrome extension named postman.

    2019-08-10[Java]

    阅读更多
  • Unit Test Spring MVC Rest Service: MockMVC, JUnit, Mockito

    Previously we saw how to create a spring mvc restful web service. In this tutorial we continue by showing how to unit test this spring mvc rest service using JUnit, Mockito and Spring Test (MockMVC).

    2019-08-10[Java]

    阅读更多
  • Spring Boot Thymeleaf Configuration Example

    Spring Boot Thymeleaf Configuration Example

    This tutorial demonstrates how to configure Spring Boot and Thymeleaf. We are creating a simple Spring Boot Thymeleaf Example. In this example we configure Spring Boot using application.yml file and place the Thymeleaf templates in the src/main/resources/templates folder. We also utilise org.webjars to load static resources like bootstrap and jquery.

    2019-08-10[Java]

    阅读更多
  • Spring Kafka Consumer and Producer Example

    Spring Kafka  Consumer and Producer Example

    This tutorial demonstrates how to send and receive messages from Spring Kafka. We start by creating a Spring Kafka Producer which is able to send messages to a Kafka topic. Next we create a Spring Kafka Consumer which is able to listen to messages send to a Kafka topic. We configure both with appropriate key/value serializers and deserializers. Finally we demonstrate the application using a simple Spring Boot application.

    2019-08-10[Java]

    阅读更多
  • Spring Kafka Adding Custom Header to Kafka Message Example

    In this tutorial we demonstrate how to add/read custom headers to/from a Kafka Message using Spring Kafka. We start by adding headers using either Message<?> or ProducerRecord<String, String>. Followed by reading the values inside the KafkaListener using @Header annotation and MessageHeaders class.

    2019-08-10[Java]

    阅读更多
  • Spring Kafka JSON Serializer and Deserializer Example

    The following tutorial demonstrates how to send and receive a Java Object as a JSON byte[] to and from Apache Kafka using Spring Kafka, Spring Boot and Maven. We’ll send a Java Object as JSON byte[] to a Kafka Topic using a JsonSerializer. Afterwards we’ll configure how to receive a JSON byte[] and automatically convert it to a Java Object using a JsonDeserializer.

    2019-08-10[Java]

    阅读更多
  • Spring Kafka Batch Listener Example

    In the following tutorial we demonstrate how to setup a batch listener using Spring Kafka, Spring Boot and Maven. We start by configuring the BatchListener. You can optionally configure a BatchErrorHandler. We also demonstrate how to set the upper limit of batch size messages. When we receive messages we also have the possibility of grabbing header values for individual messages.

    2019-08-10[Java]

    阅读更多
  • Spring Kafka and Spring Boot Configuration Example

    In the following tutorial we demonstrate how to configure Spring Kafka with Spring Boot. Spring Boot uses sensible default to configure Spring Kafka. We can override these defaults using the application.yml property file.

    2019-08-10[Java]

    阅读更多
  • Spring Kafka Forwarding Listener Results using @SendTo

    This tutorial demonstrates how to forward listener results using the @SendTo annotation using Spring Kafka, Spring Boot and Maven. We can use static typed topics, runtime expressions or application initialization expressions. Take a look at the following example.

    2019-08-10[Java]

    阅读更多
  • Spring Boot + Spring Security + Thymeleaf Form Login Example

    Spring Boot + Spring Security + Thymeleaf Form Login Example

    This tutorial demonstrates how to configure spring-boot, spring-security and thymeleaf with form-login. We secure our web application using spring security form-login. We create a reusable Thymeleaf layout which we can use to create our secured and unsecured pages. When a user accesses a protected resource with insufficient rights we redirect the user to an access-denied page. Finally we create a login page where the user is able to login to the application. And we create a logout link.

    2019-08-10[Java]

    阅读更多
  • Spring Security Basic Authentication Configuration Example

    Spring Security Basic Authentication Configuration Example

    The following tutorial is about Spring Security Basic Authentication Configuration. We demonstrate this by configuring Spring Security using both Java and XML Configuration. We create a custom authentication entry point which we can use and customize to give the user a custom login error message. We finish with showing how to write some integration tests using Spring MockMvc and JUnit.

    2019-08-10[Java]

    阅读更多
  • Spring Security Method Level Annotations Example

    Spring Security Method Level Annotations Example

    This tutorial demonstrates how to use Spring Security Method Level Annotations. We can use Spring Security to secure our service layer. We can restrict which roles are able to execute a method by annotating the method with any of spring security annotations or the standard java JSR-250 annotaitons.

    2019-08-10[Java]

    阅读更多
共有 325 条记录 首页 << 131415161718192021末页

 


  • 微信公众号

  • 我的微信

站点声明:

1、一号门博客CMS,由Python, MySQL, Nginx, Wsgi 强力驱动

2、部分文章或者资源来源于互联网, 有时候很难判断是否侵权, 若有侵权, 请联系邮箱:summer@yihaomen.com, 同时欢迎大家注册用户,主动发布无版权争议的 文章/资源.

3、鄂ICP备14001754号-3, 鄂公网安备 42280202422812号