Skip to content
Snippets Groups Projects
Commit 26cbb51b authored by Julian Horner's avatar Julian Horner
Browse files

Add controller package and minor improvements

parent 768ebb47
No related branches found
No related tags found
No related merge requests found
---
applications:
- buildpack: https://github.com/cloudfoundry/staticfile-buildpack.git
host: dummy-service
name: dummy-service
memory: 64M
\ No newline at end of file
...@@ -10,7 +10,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -10,7 +10,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
/** /**
* Dummy service for microservice architecture. * Class for starting dummy service.
* *
* @author Julian * @author Julian
* *
...@@ -21,11 +21,11 @@ public class Application { ...@@ -21,11 +21,11 @@ public class Application {
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
/** /**
* Starts the application. * Start the application.
* *
* @param args The arguments * @param args The arguments
*/ */
public static void main(final String[] args) { SpringApplication.run(Application.class, args); } public static void main(String[] args) { SpringApplication.run(Application.class, args); }
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
} }
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
* All Rights Reserved. * All Rights Reserved.
*/ */
package de.rtuni.ms.ds; package de.rtuni.ms.ds.controller;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
/** /**
* Class that handles all kind of requests. * Controller that handles all requests for the dummy service.
* *
* @author Julian * @author Julian
* *
...@@ -19,9 +19,10 @@ public class HomeController { ...@@ -19,9 +19,10 @@ public class HomeController {
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
/** /**
* Catches the request for the start page and returns the name of the corresponding template. * Catch the request for the start page and return the name of the corresponding
* template.
* *
* @return The name of the template * @return The name of the template to show
*/ */
@RequestMapping("/") @RequestMapping("/")
public String index() { public String index() {
...@@ -29,9 +30,10 @@ public class HomeController { ...@@ -29,9 +30,10 @@ public class HomeController {
} }
/** /**
* Catches the request for the secure page and returns the name of the corresponding template. * Catch the request for the secure page and return the name of the corresponding
* template.
* *
* @return The name of the template * @return The name of the template to show
*/ */
@RequestMapping("/securedPage") @RequestMapping("/securedPage")
public String securedPage() { public String securedPage() {
......
# Spring properties
spring: spring:
application: application:
name: dummy-service # Identify this application name: dummy-service # Identifier of this application
# Map the error path to error template (for Thymeleaf) server.port: 3333
error.path: /error
# HTTP Server
server.port: 3333 # HTTP (Tomcat) port
eureka: eureka:
client: client:
serviceUrl: serviceUrl:
defaultZone: http://localhost:8761/eureka/ defaultZone: http://localhost:8761/eureka/ # URL of the eureka server for registration
\ No newline at end of file \ No newline at end of file
...@@ -6,6 +6,6 @@ ...@@ -6,6 +6,6 @@
</head> </head>
<body> <body>
<h1>Page without authentication</h1> <h1>Page without authentication</h1>
<a href="#" th:href="@{/securedPage}">geschützte Seite anfordern</a> <a href="#" th:href="@{/securedPage}">Request a secured page</a>
</body> </body>
</html> </html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment