Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Wilson Farias
WS-Calculator
Commits
4f3952f3
Unverified
Commit
4f3952f3
authored
May 13, 2019
by
Wilson de Farias
Browse files
Adiciona dependência JAVA-RS ao projeto (JEE-Web)
parent
daa2f25f
Changes
3
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
4f3952f3
...
...
@@ -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>
...
...
src/helloworld/HelloApplication.java
→
src/
main/java/br/ufrn/web2/
helloworld/HelloApplication.java
View file @
4f3952f3
package
helloworld
;
package
br.ufrn.web2.
helloworld
;
import
javax.ws.rs.ApplicationPath
;
import
javax.ws.rs.core.Application
;
...
...
src/helloworld/HelloWorld.java
→
src/
main/java/br/ufrn/web2/
helloworld/HelloWorld.java
View file @
4f3952f3
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment