About Question enthuware.ocejws.v6.2.218 :
Posted: Thu Apr 24, 2014 9:31 pm
Question 3:
There is a RESTful Web Service that adds two numbers:
We want to secure this Web Service in order to only allow users in the role "student". What is the correct web.xml to implement this requirement?
this is the answer that the mock test says is correct.
"This will secure all GET requests."
this might cause other web services to require "student" role as well..
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..