Hi all,
I just had given the Mock Exam for SCWCD at
www.jdiscuss.com.. I gave some wrong answers and some questions I am confused with..
Here are some of them, I need guidance for the correct answers with a brief summary..
Thanks in advance..
Question 1 : Assuming that the servlet container is distributed across multiple JVMs, which of the following statements are correct? (Select 2 correct options.)
1) A separate instance of a non-default servlet context will be available on each of the JVMs.
2) A separate instance of all servlet context will be avaible on each of the JVMs.
3) The default servlet context will be present only on one of the JVMs.
4) There is only one instance of servlet contexts across all the JVMs.
5) None of the above
Answers from JDiscuss : (1 & 3)
(Can anybody explain me what does Default Servlet Context means..?

)
Question 2 : You are developing a web application which needs to store a lot of data in persistant storage. As of now, your company does not have any database and so you can only use the file system to store the data. But if the webapp goes well, the company may buy an industrial strength database. Which design pattern would be useful for you in this case which will help you reduce your work load later? (Select 1 correct option.)
1) MVC
2) Business Delegate
3) File DB pattern
4) Data Access Object
5) Data Store Pattern
Answers from JDiscuss : (4)
(Does the real exam will have questions of Design Patterns other than the 6 discussed in HFSJ..?)
Question 3 : Which of the following things may happen in the translation phase of a JSP page? (Select 2 correct options.)
1) Execution of _jspService() method.
2) Execution of jspInit() method.
3) Creation of the servlet class corresponding to the JSP file.
4) Instantiation of the servlet class.
5) Loading of the servlet class.
Answers from JDiscuss : (3 & 5)
But I think, Loading the Servlet Class is not part of Translation phase..?
Question 4 : Identify the techniques that can be used to implement 'sessions' if the client browser does not support cookies. (Select 3 correct options. )
1) Using Http headers.
2) Using https protocol.
3) Hidden form fields.
4) URL rewriting
5) It cannot be done without cookie support.
Answer from JDiscuss : (1, 3, 4)
Question 5 : You do not want multiple threads to be executing your servlet's methods because its methods are not thread safe. What is the right way to ensure this? (Select 2 correct options.)
1) Make its methods synchronized.
2) Make it implement MultiThreadModel.
3) Make it implement SingleThreadModel.
4) You don't need to do anything as the container automatically takes care of this.
Answer from JDiscuss : (1, 3)
Question 6 : You want to use a bean that is stored in com/enthu/GUI.ser file. Which of following statements correctly defines the tag that accesses the bean? (Select 1 correct option.)
1) <jsp:useBean id="pref" name="com/enthu/GUI.ser" />
2) <jsp:useBean id="pref" name="com.enthu.GUI" />
3) <jsp:useBean id="pref" type="com/enthu/GUI.ser" />
4) <jsp:useBean id="pref" beanName="com.enthu.GUI" type="com.enthu.GUI"/>
5) <jsp:useBean id="pref" class="com.enthu.GUI.ser" />
Answer from JDiscuss : (I selected 4 and was correct)
Query : Is this thing (Serialized Bean) covered in HFSJ or Real Exam..?
Question 7 : In which of the following situations will a session be definitely invalidated? (Select 2 correct options.)
1) The container is shutdown and brought up again.
2) No request comes from the client for more than "session timeout" period.
3) A servlet explicitly calls invalidate() on a session object.
4) If the session time out is set to 0 using setMaxInactiveInterval() method, the session will never be invalidated automatically.
Answer from JDiscuss : (2 & 3)
Query : Why Option 1 can not be the answer..?
Quesion 8 : Assuming that the Servlet Container has just called destroy() method of a servlet instance, which of the following statements are correct? (Select 2 correct options.)
1) Any resources that this servlet might hold have been released.
2) The servlet container time out has exceeded for this servlet instance.
3) The init() method has been called on this instance.
4) None of the requests can EVER be serviced by this instance.
5) All threads created by this servlet are done.
Answer from JDiscuss : (3 & 4)
Question 9 : Which of the following XML elements should be present in a deployment descriptor of a web application so that it can be distributed accross multiple JVMs? (Select 1 correct option.)
1) <distributable/>
2) <distributable>true</distributable>
3) <distributed/>
4) <distributed>true</distributed>
5) <distribute>true</distribute>
Answer from JDiscuss : 1
Need help for answers & Clarification..
Thanks..!