fix(ch4s4): refactor java source for SG read ease
This commit is contained in:
parent
a4c63d7a84
commit
2c450b33f4
1 changed files with 14 additions and 14 deletions
|
|
@ -1,26 +1,26 @@
|
|||
package com.redhat.training.example.javaserverhost.rest;
|
||||
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Produces;
|
||||
import java.net.InetAddress;
|
||||
|
||||
|
||||
@Path("/")
|
||||
public class ServerHostEndPoint {
|
||||
|
||||
@GET
|
||||
@Produces("text/plain")
|
||||
public Response doGet() {
|
||||
String host = "";
|
||||
try {
|
||||
host = InetAddress.getLocalHost().getHostName();
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return Response.ok("I am running on server "+host+" Version 1.0 \n").build();
|
||||
}
|
||||
@GET
|
||||
@Produces("text/plain")
|
||||
public Response doGet() {
|
||||
String host = "";
|
||||
try {
|
||||
host = InetAddress.getLocalHost().getHostName();
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String msg = "I am running on server "+host+" Version 1.0 \n"
|
||||
return Response.ok(msg).build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue