All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.acme.GreetingResource Maven / Gradle / Ivy

There is a newer version: 0.9.1
Show newest version
package org.acme;

import jakarta.ws.rs.DefaultValue;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.MediaType;

@Path("/hello")
public class GreetingResource {
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello(@QueryParam("user") @DefaultValue("developer") String user) throws Exception {

        String greeting = System.getenv("GREETING_ENV");
        if (greeting == null)
            greeting = "Greetings";
        String message = "" + greeting + " ZOYO " + user;
        return message;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy