Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

Shobhan Ganta

Ranch Hand
+ Follow
since Nov 11, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shobhan Ganta

Hi Christophe,

Thanks for your reply. My question is not knowing/learning about EJB's but getting certified. I have quite lot of experience working on EJB 2.0/3.0 specification. my point here is how importance does EJB certification carry in the present market?

Thanks
Shobhan
Howdy Ranchers,

I would like to know whether it's worth to put effort in taking SCBCD certification any more as there are a lot of open source frameworks(e.g, spring) around. I know it's worth for those who have been working extensively on EJB's.
But I am wondering how important is this certification in the present/future market?

Please let me know your thoughts

Thanks
Shobhan
Congratulations Nidhi..I guess 88% is a very good score

Regards
Shobhan
11 years ago
hi Roberto,

I mean mock up tests.

Thanks
Shobhan
11 years ago
Hi Ranchers,

I passed the SCWCD today with a score of 90%. Want to thank all ranchers for help/advice during the time. It's been of great help.
Study Material I used:
- Head First Servlets & JSP 2nd edition
- Excellent PDF summary Scwcd-15-Notes-III.pdf
-scwcd_dumps

Thanks
- Shobhan
11 years ago
Thanks Pedro.

The HttpSessionBindingListener has a HttpSessionBindingEvent, which in turn has a getSession() method which returns... a session object :-)


This explains how we can get HttpSession from HttpSessionBindingEvent and call removeAttribute() method.

Thanks
Shobhan
Hi,

This question is from one of the mockup tests in webpage

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.



The correct answer given is A.

But HttpSessionBindingListener doesn't have removeAttribute() method, so it should have been HttpSessionAttributeListener which contains the removeAttribute() method.

Thanks
Shobhan
Hi Nidhi,

Does it have something to do with the 'servlet container root' instead of 'application root'?



I think whatever Pedro said is correct.
the response.sendRedirect() method expects its path parameter to be relative to the server root, not the webapp root. Thus, to send a redirect to the above URL from a servlet running , you must say

response.sendRedirect(request.getContextPath() +"/help/index.html");



please ignore my earlier post.
Thanks
Shobhan
Thanks Nidhi for confirming.
Hi Seeta,

Thanks for replying to my post.

The default behavior if auth-constraint tag is not provided is every one can access the resource.



This above statement is correct only if none of the role-name present inside auth-constraint tag.
but Optin D states if only the second security constraint tag is removed we still have first security role. hence I suspect option D is not correct.

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



Thanks
Shobhan
Hi,

This question is from HFSJ final mock exam.

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.



The correct answer given is option D.

But I guess it should be option F? Can someone please explain?

Thanks
Shobhan
Hi All,

This question is from HFSJ mock exam 11 Q.9

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>



The correct answer given is A, C (explanation : (servlet spec 9.11)-In addition, <ejb-local-ref> also provides the web app creator with a JNDI reference to J2EE components.)

but I feel the following code snippet will be used for declaring the JNDI access.

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



I don't see any of these tags available in the question options. Can someone please explain?

Thanks
Shobhan
Hi Rachers,

This question is from HFSJ mock exam 10. Q. 9

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;



The correct answer is B. where as I tend to go for option C. the explanantion given is

Option C is invalid because it directs the body of the tag to a buffer which this tag does not process.




Can someone please explain?

Thanks
Shobhan