About Question enthuware.jwpv6.2.645

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
Posts: 1
Joined: Sat Jun 01, 2013 7:06 am

About Question enthuware.jwpv6.2.645

Post by dsemionov » Sat Jun 01, 2013 7:28 am


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);

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.".


Site Admin
Posts: 8621
Joined: Fri Sep 10, 2010 9:26 pm

Re: About Question enthuware.jwpv6.2.645

Post by admin » Sat Jun 01, 2013 9:45 am

You are right. It should be servletSecurity. This has now been fixed.

thank you for your feedback!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests