diff --git a/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/HelloSpringResource.java b/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/HelloSpringResource.java index 041e96fee4..efd911cd28 100644 --- a/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/HelloSpringResource.java +++ b/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/HelloSpringResource.java @@ -50,8 +50,8 @@ public class HelloSpringResource { @Produces("text/html") public Response getDefault(@Context UriInfo uriInfo) { String baseURI = uriInfo.getBaseUri().toString(); - baseURI = baseURI + "main"; if (!baseURI.endsWith("/")) baseURI += '/'; + baseURI = baseURI + "main/"; String msg = "Hello.
Please try spring-resteasy/main/hello?name=yourname" + "
Or try spring-resteasy/main/basic" + "
Or try spring-resteasy/main/queryParam?param=query" diff --git a/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/RootResource.java b/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/RootResource.java index c6e7c2c416..a5aa71e22d 100644 --- a/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/RootResource.java +++ b/spring-resteasy/src/main/java/org/jboss/as/quickstarts/resteasyspring/RootResource.java @@ -1,16 +1,23 @@ package org.jboss.as.quickstarts.resteasyspring; +import jakarta.ws.rs.core.Context; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.UriInfo; @Path("/") public class RootResource { @GET @Produces("text/html") - public String getRootResponse() { - String responsemsg = "Hello There! Welcome to WildFly!
Spring-resteasy quickstart has been deployed and running successfully.
You can find the available operations in the included README file."; + public String getRootResponse(@Context UriInfo uriInfo) { + String baseURI = uriInfo.getBaseUri().toString(); + if (!baseURI.endsWith("/")) baseURI += '/'; + baseURI = baseURI + "main/"; + String responsemsg = "Hello There! Welcome to WildFly!" + + "
Spring-resteasy quickstart has been deployed and running successfully. " + + "
You can find the available operations here or in the included README file."; return responsemsg; } } diff --git a/spring-resteasy/src/test/java/org/jboss/as/quickstarts/resteasyspring/test/BasicRuntimeIT.java b/spring-resteasy/src/test/java/org/jboss/as/quickstarts/resteasyspring/test/BasicRuntimeIT.java index 7e58093926..1e71a91417 100644 --- a/spring-resteasy/src/test/java/org/jboss/as/quickstarts/resteasyspring/test/BasicRuntimeIT.java +++ b/spring-resteasy/src/test/java/org/jboss/as/quickstarts/resteasyspring/test/BasicRuntimeIT.java @@ -38,7 +38,7 @@ public class BasicRuntimeIT { @Test public void testHTTPEndpointIsAvailable() throws IOException, InterruptedException, URISyntaxException { final HttpRequest request = HttpRequest.newBuilder() - .uri(new URI(getServerHost()+"/")) + .uri(new URI(getServerHost())) .GET() .build(); final HttpClient client = HttpClient.newBuilder() diff --git a/spring-resteasy/src/test/java/org/jboss/as/quickstarts/resteasyspring/test/TestUtils.java b/spring-resteasy/src/test/java/org/jboss/as/quickstarts/resteasyspring/test/TestUtils.java index 96d2254409..26506607df 100644 --- a/spring-resteasy/src/test/java/org/jboss/as/quickstarts/resteasyspring/test/TestUtils.java +++ b/spring-resteasy/src/test/java/org/jboss/as/quickstarts/resteasyspring/test/TestUtils.java @@ -17,7 +17,7 @@ public class TestUtils { static final String DEFAULT_SERVER_HOST = "http://localhost:8080/spring-resteasy"; - static final String MAINPAGE_PATH = "/main"; + static final String MAINPAGE_PATH = "/main/"; static String getServerHost() { String serverHost = System.getenv("SERVER_HOST");