The HttpSessionBindingListener has a HttpSessionBindingEvent, which in turn has a getSession() method which returns... a session object :-)
Q: 130 You have a use case in your web application that adds several session-scoped
attributes. At the end of the use case, one of these objects, the manager attribute, is removed and then it
needs to decide which of the other session-scoped attributes to remove.
How can this goal be accomplished?
A. The object of the manager attribute should implement the HttpSessionBindingListener and it should call the
removeAttribute method on the appropriate session attributes.
B. The object of the manager attribute should implement the HttpSessionListener and it should call the
removeAttribute method on the appropriate session attributes.
C. The object of the manager attribute should implement the HttpSessionBindingListener and it should call the
deleteAttribute method on the appropriate session attributes.
D. The object of the manager attribute should implement the HttpSessionListener and it should call the
deleteAttribute method on the appropriate session attributes.
Does it have something to do with the 'servlet container root' instead of 'application root'?
response.sendRedirect(request.getContextPath() +"/help/index.html");
The default behavior if auth-constraint tag is not provided is every one can access the resource.
When two different non-empty <auth-constraint> elements apply to the same constrained resource,
access is granted to the union of all roles from both of the <auth-constraint> elements
Your web application has a valid deployment descriptor in which student and
sensei are the only security roles that have been defined. The deployment
descriptor contains two security constraints that declare the same resource to
be constrained. The first security constraint contains:
234. <auth-constraint>
235. <role-name>student</role-name>
236. </auth-constraint>
And the second security constraint contains:
251. <auth-constraint/>
Which are true? (Choose all that apply.)
A. As the deployment descriptor stands now, the constrained resource can
be accessed by both roles.
B. As the deployment descriptor stands now, the constrained resource can
be accessed only by sensei users.
C. As the deployment descriptor stands now, the constrained resource can
be accessed only by student users.
D. If the second <auth-constraint> tag is removed, the constrained
resource can be accessed by both roles.
E. If the second <auth-constraint> tag is removed, the constrained
resource can be accessed only by sensei users.
F. If the second <auth-constraint> tag is removed, the constrained
resource can be accessed only by student users.
Which are DD elements that provide JNDI access to J2EE components?
(Choose all that apply.)
A. <ejb-ref>
B. <entity-ref>
C. <ejb-local-ref>
D. <session-ref>
E. <ejb-remote-ref>
<env-entry>
<env-entry-name>rates/discountRate</env-entry-name>
<env-entry-type>java.lang.Integer</env-entry-type>
<env-entry-value>10</env-entry-value>
</env-entry>
Given:
10. public class BufTag extends BodyTagSupport {
11. public int doStartTag() throws JspException {
12. // insert code here
13. }
14. }
Assume that the tag has been properly configured to allow body content.
Which, if inserted at line 12, would cause the JSP code
<mytags:mytag>BodyContent</mytags:mytag> to output
BodyContent?
A. return SKIP_BODY;
B. return EVAL_BODY_INCLUDE;
C. return EVAL_BODY_BUFFERED;
D. return BODY_CONTENT;
Option C is invalid because it directs the body of the tag to a buffer which this tag does not process.