There is a RESTful Web Service that adds two numbers:
Code: Select all
@ApplicationPath("jax")
@Path("rs")
public class AdditionService extends Application {
@GET
@Path("/add/{num1}/{num2}")
public String addp(@PathParam("num1") int num, @PathParam("num2") int num2){
return "" + (num+num2);
}
}
this is the answer that the mock test says is correct.
Code: Select all
<security-constraint>
<web-resource-collection>
<web-resource-name>secure addition</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>student</role-name>
</auth-constraint>
</security-constraint>
this might cause other web services to require "student" role as well..