Hello,
It seems that there is a mistake in question. From the following code we can see that there should be compilation error:
HttpConstraintElement constraint = new HttpConstraintElement(TransportGuarantee.NONE, new String[]{"employee"});
List<HttpMethodConstraintElement> methodConstraints = new ArrayList<HttpMethodConstraintElement>();
methodConstraints.add(new HttpMethodConstraintElement("GET", constraint ));
ServletSecurityElement servletSecurity = new ServletSecurityElement(constraint, methodConstraints);
ServletRegistration.Dynamic sd = ctx.addServlet("dynamicServlet", myDynamicServletClass);
sd.addMapping("/dynamic");
sd.setServletSecurity(myServletSecurity);
sd.addMapping("/secureDynamic");
There is no reference with name "myServletSecurity" created, instead of it there is "servletSecurity" created. So the correct answer chould be "None of these" instead of "A user must be in employee role to access /dynamic but not /secureDynamic through HTTP GET method.".
BR,
Dmitrij
About Question enthuware.jwpv6.2.645
Moderators: Site Manager, fjwalraven
-
- Posts: 1
- Joined: Sat Jun 01, 2013 7:06 am
- Contact:
-
- Site Admin
- Posts: 10090
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.645
You are right. It should be servletSecurity. This has now been fixed.
thank you for your feedback!
thank you for your feedback!
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 13 guests