Commit ab3dd39d by Patryk Czarnik

Hello world w JAX-RS

parent 636cd479
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>pl.alx.kjava</groupId> <groupId>pl.alx.kjava</groupId>
<artifactId>PC32-RetSerwer</artifactId> <artifactId>PC32-RestSerwer</artifactId>
<version>1.0</version> <version>1.0</version>
<packaging>war</packaging> <packaging>war</packaging>
......
package sklep.rest;
import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;
@ApplicationPath("/")
public class AplikacjaRestowa extends Application {
// Ta klasa jest konfiguracją usługi RESTowej. Jedna taka klasa powinna się znajdować w projekcie.
// Jeśli chcemy zdać się na domyślną konfigurację, pozostawiamy tę klasę pustą.
// Aby coś zmienić, można nadpisać metody.
}
package sklep.rest;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
@Path("/hello")
public class RHello {
@GET
public String hello() {
return "Hello world!";
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment