Unverified Commit 4f3952f3 authored by Wilson de Farias's avatar Wilson de Farias
Browse files

Adiciona dependência JAVA-RS ao projeto (JEE-Web)

parent daa2f25f
......@@ -9,6 +9,11 @@
<version>1.0</version>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>8.0</version>
</dependency>
</dependencies>
<build>
......
package helloworld;
package br.ufrn.web2.helloworld;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
......
package helloworld;
package br.ufrn.web2.helloworld;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
......@@ -13,7 +13,7 @@ import javax.ws.rs.core.UriInfo;
*/
@Path("helloworld")
public class HelloWorld {
@Context
private UriInfo context;
......@@ -30,14 +30,14 @@ public class HelloWorld {
public String getHtml() {
return "<html lang=\"en\"><body><h1>Hello, World!!</h1></body></html>";
}
@GET
@Path("{username}")
@Produces("text/html")
public String getHtmlUser(@PathParam("username") String username) {
return "<html lang=\"en\"><body><h1>Hello,"+ username + "!!</h1></body></html>";
}
/**
* PUT method for updating or creating an instance of HelloWorld
* @param content representation for the resource
......
Supports Markdown
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