Skip to content

Commit

Permalink
minor upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenp committed Sep 22, 2015
1 parent 6da1ecf commit a5375cb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion spring-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
<version>1.2.6.RELEASE</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion spring-boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
<version>1.2.6.RELEASE</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion spring-security-login-and-registration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
<version>1.2.6.RELEASE</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion spring-security-rest-full/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
<version>1.2.6.RELEASE</version>
</parent>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package org.baeldung.web.controller;

import com.google.common.base.Preconditions;
import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.baeldung.persistence.model.Foo;
import org.baeldung.persistence.service.IFooService;
import org.baeldung.web.exception.MyResourceNotFoundException;
Expand All @@ -14,11 +17,16 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.util.UriComponentsBuilder;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import com.google.common.base.Preconditions;

@Controller
@RequestMapping(value = "/foos")
Expand Down Expand Up @@ -81,7 +89,7 @@ public List<Foo> findPaginated(@RequestParam("page") final int page, @RequestPar
@ResponseBody
public Foo create(@RequestBody final Foo resource, final HttpServletResponse response) {
Preconditions.checkNotNull(resource);
Foo foo = service.create(resource);
final Foo foo = service.create(resource);
final Long idOfCreatedResource = foo.getId();

eventPublisher.publishEvent(new ResourceCreatedEvent(this, response, idOfCreatedResource));
Expand All @@ -105,7 +113,7 @@ public void delete(@PathVariable("id") final Long id) {

@RequestMapping(method = RequestMethod.HEAD)
@ResponseStatus(HttpStatus.OK)
public void head(HttpServletResponse resp) {
public void head(final HttpServletResponse resp) {
resp.setContentType(MediaType.APPLICATION_JSON_VALUE);
resp.setHeader("bar", "baz");
}
Expand Down

0 comments on commit a5375cb

Please sign in to comment.