This commit is contained in:
2026-05-14 21:58:46 +02:00
parent 1ab7c5836d
commit 1f51386b57
6 changed files with 710 additions and 578 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>ejb-server</artifactId>
<packaging>ejb</packaging>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>jakarta.enterprise</groupId>
@@ -0,0 +1,8 @@
package org.example.webservice;
import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;
@ApplicationPath("/")
public class ApplicationConfig extends Application {
}
@@ -0,0 +1,17 @@
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@Path("/time")
public class TimeService {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String getTime() {
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm:ss");
return "Aktuelle Serverzeit: " + now.format(formatter);
}
}