Browse Source

Implement a controller for development end points

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.4-alpha
Pekka Helenius 4 years ago
parent
commit
0a3e775c1a
1 changed files with 51 additions and 0 deletions
  1. +51
    -0
      bookstore/src/main/java/com/fjordtek/bookstore/web/BookDevController.java

+ 51
- 0
bookstore/src/main/java/com/fjordtek/bookstore/web/BookDevController.java View File

@ -0,0 +1,51 @@
//Pekka Helenius <fincer89@hotmail.com>, Fjordtek 2020
package com.fjordtek.bookstore.web;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.fjordtek.bookstore.service.HttpServerLogger;
/**
*
* This class implements a Spring Model View controller for bookstore development
* end points.
*
* @author Pekka Helenius
*/
@Controller
@RequestMapping("${page.url.dev}")
@Profile("dev")
public class BookDevController {
@Autowired
private Environment env;
@Autowired
private HttpServerLogger httpServerLogger;
//////////////////////////////
// SPRING ACTUATOR HELP PAGE
@RequestMapping(
value = "${page.url.dev.statsref}",
method = { RequestMethod.GET }
)
public String webFormActuatorRef(
HttpServletRequest requestData,
HttpServletResponse responseData
) {
httpServerLogger.log(requestData, responseData);
return env.getProperty("page.url.dev.statsref");
}
}

Loading…
Cancel
Save