Scwcd Exam Guide (covers Java Ee5)

(Paperback - 2008)
by

Kunal Jaggi

Write a Review
List Price:Rs. 595
Our Price:Rs. 595
Discount:Rs. 0
    Free Shipping

Available. Order now and get it in 8-10 business days. See Details

All India - Free Shipping. See Details
Ships to India only.

Buy online using:
- Debit Card / Internet Banking / ATM Card
- Credit Card (VISA & MasterCard)
- Cheque, Demand Draft or Money Order. See Details


Publisher: Tata Mgraw Hill



OR



Book: Scwcd Exam Guide (covers Java Ee5)

Table of contents
  • HTTP basics
  • Servlet Technology Model
  • The Web Container Model
  • Session Tracking
  • Designing and Developing Thread Safe Servlets
  • Structure and Deployment of Web Applications
  • Web Application Security
  • Servlet Filters
  • JSP Technology Model
  • Designing and Developing Reusable Web Components
  • Script-free JSP Development with JavaBeans
  • JSP Expression Language
  • Using JSTL
  • Developing Custom Tags
  • Java EE Design Patterns
  • JavaServer Faces Technology
  • Appendix A: Installation Instructions

    EXERCISE ANSWERS

    CHAPTER 1 - HTTP BASICS


    1. D Explanation: Being a non-idempotent method, POST is ideal for removing/adding articles to a shopping cart.
    2. E Explanation: GET is the default HTTP method.
    3. D and F
    4. B

    CHAPTER 2 - SERVLET TECHNOLOGY MODEL


    1. C Explanation: GET is the default HTTP method.
    2. C Explanation: The ServletResponse.setContentType(String mimeType) method is used to set the content type of the response being sent to the client. A value of image/gif is used to send a GIF image.
    3. D and E Explanation: The servlet specification doesn?t support HTTP 1.1 CONNECT method. The init() and detroy() callbacks are called only once during the lifecycle of a servlet.
    4. D Explanation: The ServletResponse interface provides the getOutputStream() method for writing binary data in the response, and getWriter() method to send character text to the client.
    5. A
    6. B and E
    7. E
    8. C Explanation: Calling the HttpServletResponse.sendRedirect(String url) method after committing the response will throw an IllegalStateException.
    9. C
    10. D Explanation: Overriding just the service method can process all HTTP requests (except CONNECT).

    CHAPTER 3 - WEB CONTAINER MODEL


    1. D and E
    2. D Explanation: The deployment descriptor tag is used to set web app specific initialization parameters that can be read from all deployed components through a ServletContext implementation.
    3. A
    4. B and E Explanation: Scope range (widest to narrowest)-application, session, request.
    5. C and D Explanation: The getAttribute (String name) method returns the value of the named attribute as an Object, or null if no attribute the given name exists.
    6. C Explanation: The deployment descriptor tag defines the listener implementation class that is invoked when an event occurs.
    7. D Explanation: The contextInitialized(ServletContextEvent sce) method notifies that the web application is ready to process requests.
    8. C
    9. E Explanation: A RequestDispatcher implementation can be obtained either through a ServletContext implementation or ServlerRequest implementation. In case of RequestDispatcher.forward(), the originating servlet is not allowed to modify the response in any way.
    10. B Explanation: You can?t forward/redirect the request if you have already committed the response. Any attempt of calling flush() on the output stream will result in an IllegalStateException at runtime.

    CHAPTER 4 - SESSION TRACKING


    1. C
    2. B Explanation: The deployment descriptor element sets the lifetime of the application?s HttpSession objects in minutes.
    3. B Explanation: The setMaxlnactivelnterval(int interval) method specifies the time, in seconds.
    4. B and D
    5. B and E Explanation: Calling getSession() and getSession(true) has the same effect, a new session object will be returned.
    6. C
    7. B
    8. D
    9. C
    10. D Explanation: HTTP is a stateless protocol, the server has no way of knowing that a user has closed the browser window. User?s can?t disable URL rewriting.

    CHAPTER 5 - DESIGNING AND DEVELOPING THREAD SAFE SERVLETS


    1. A
    2. E Explanation: SingleThreadModel is a marker interface.
    3. C
    4. A and B
    5. B
    6. A, B and C
    7. B and D
    8. B, D and E

    CHAPTER 6 - STRUCTURE AND DEPLOYMENT OF WEB APPLICATIONS


    1. B
    2. D Explanation: Servlet class files, JavaBean classes, listener classes and any other utility classes are placed either inside the WEB-INF/classes directory or packed in a JAR and placed inside the WEB-INF/lib directory.
    3. E Explanation: The DD elements can appear in any order in Servlets 2.4.
    4. A and D Explanation: The deployment descriptor element is used to map either an HTTP status code or a fully qualified exception class to a location, not both.
    5. C
    6. A, C and E Explanation: Any resource outside the WEB-INF directory can be directly requested by a client.
    7. B
    8. C and D
    9. C Explanation: The deployment descriptor element can map a servlet () to a URL pattern ().
    10. D
    11. B Explanation: The container will match the request to the longest possible match.
    12. C
    13. C

    CHAPTER 7 - WEB APPLICATION SECURITY


    1. B
    2. A, C and D
    3. C and D
    4. A, B, C and D Explanation: The servlet API doesn?t support the HTTP 1.1 CONNECT method
    5. B and E
    6. D
    7. C Explanation: If is not present, it means everyone will be granted access.
    8. B
    9. C
    10. B Explanation: If is empty, it means no one will be granted access.
    11. D
    12. B

    CHAPTER 8 - SERVLET FILTERS


    1. E Explanation: A Decorator component creates a wrapped implementation of request/response objects. The filter execution order can be swapped by tweaking the element in the web application deployment descriptor file.
    2. A and C
    3. D Explanation: Filter components can also be executed as a result of RequestDispatcher.forward() or lnclude() calls. A filter can also be used to post-process on the response.
    4. E Explanation: The /* URL maps all resources in the Web application to the filter.
    5. B and D
    6. B and D
    7. C

    CHAPTER 9 - JSP TECHNOLOGY MODEL


    1. D Explanation: A JSP page author can override the jsplnit() and jspDestroy() methods. The JSP engine implements the _ jspService() callback.
    2. B and C Explanation: Anything placed between the <%= and %> is passed as an argument to the out.print() method.
    3. B Explanation: Only javax.servlet, javax.servlet.http and javax.servlet.jsp packages are by default imported in the generated servlet.
    4. A, B and D
    5. D Explanation: The application implicit object refers to an implementation of the ServletContext implementation.
    6. B, C and E Explanation: The JSP engine provides the _jspService() method.
    7. C, D and E
    8. E
    9. D
    10. A and D

    CHAPTER 10 - DESIGNING AND DEVELOPING REUSABLE WEB COMPONENTS


    1. C Explanation: The include directive (also called translation time inclusion mechanism) reads the contents of the specified file in the translation phase.
    2. A Explanation: With include directive, each page can access scriptlets, declarations and expressions defined in the including page.
    3. A Explanation: The include standard action includes the response produced by executing the page at request processing phase.
    4. B and C Explanation: The jsp:param element can only be used in the jsp:include and jsp:forward actions.
    5. C Explanation: An absolute URI starting with a /, then the path is relative to the Web application?s context root (tatamcgrawhill).
    6. B Explanation: Under the hood, action is equivalent to RequestDispatcher.forward() call.
    7. E Explanation: With , the included pages are first themselves translated and compiled. Since the book_title variable is not declared in checkAvailability.jsp file; the JSP engine will throw a compilation error.
    8. C Explanation: With include directive, the included components are never translated or compiled instead, their contents are merged in the including page.
    9. B Include is location sensitive; the JSP engine will merge the included page?s contents exactly at the place of the include directive. An included page cannot set headers or change status code. should not be called after flushing the response. No scripting elements are shared when standard action is used.
    10. C Explanation: Flushing the page output before forwarding will throw an IllegalStateException.

    CHAPTER 11 - SCRIPT FREE JSP DEVELOPMENT WITH JAVABEANS


    1. D Explanation: id is a mandatory attribute in standard action; either class or a type attribute should be present.
    2. B, E and F Explanation: A POJO bean must define a public default constructor. If the scope attribute is omitted, it defaults to page scope.
    3. B and C Explanation: The action can accept either constant string or JSP expression.
    4. B and E Explanation: According to JavaBeans naming convention, the first character of each property identifier must appear in upper case in getter and setter methods.
    5. C, D and E Explanation: The type attribute can refer to the class itself, a super class, an abstract class extended by the class or an interface implemented by the bean class. If the type attribute is not specified, it?s value is the same as the class attribute.
    6. A and C
    7. C Explanation: The body of the action is executed only if the bean doesn?t exist in the specified scope and a new instance is created.
    8. C Explanation: Every JSP translation unit has access to an implicit object called application which refers a ServletContext implementation.
    9. A and D

    CHAPTER 12 - JSP EXPRESSION LANGUAGE


    1. C
    2. A and C Explanation: request and session are not implicit EL objects.
    3. B
    4. C
    5. B
    6. B
    7. C Explanation: The element is a child element of the element; it contains the path of the tag library descriptor.

    CHAPTER 13 - USING JSTL


    1. D
    2. C Explanation: The TLD file should be in a Web application?s CLASSPATH.
    3. D Explanation: The tag encodes the URL by adding extra info.
    4. A, B and D
    5. B Explanation: The deployment descriptor element is used to associate the location of a JSP TLD file with a URl pattern.
    6. C
    7. A Explanation: JSTL doesn?t provide a Java language counterpart of the try block.

    CHAPTER 14 - USING CUSTOM TAGS


    1. D Explanation: .tag files should be in the Web application?s CLASSPATH.
    2. B
    3. C Explanation: A return value of SKIP_PAGE tells the JSP engine not to evaluate the rest of the page and not to include it in the output.
    4. B, C and D Explanation: Simple tags can?t contain any scripting elements in the body.
    5. E
    6. A and E
    7. B
    8. A
    9. D
    10. D
    11. E Explanation: There is no default value. If required, you should put one explicitly, like ?scriptless?.

    CHAPTER 15 - SERVLET FILTERS


    1. B Explanation: Transfer Object or Value Object pattern can reduce the number of remote calls for accessing different properties of a business component.
    2. D Explanation: Servlet filters, an implementation of the Interceptor filter design pattern are best suited for running any security/encryption logic before a request can be forwarded to its destination.
    3. A Explanation: A Service Locator can be used to hide remote APls from a client.
    4. D Explanation: MVC pattern separates view generation from business logic implementation.
    5. A Explanation: Front controller is used to provide a single point of access for all incoming user requests into a Web app.
    6. C Explanation: MVC can be used to create view pages which can service diverse clients.
    7. C and D Explanation: Transfer object sits between a client and intended business components.
    8. C Explanation: Servlet filers are declaratively configured in the web.xml artifact.
    9. B
    10. B


    New Features


  • SCWCD Exam Guide is for Java programmers and developers who want to appear for SCWCD exam. It covers Web presentation tier of Java EE 5 platform and helps you to:

  • Prepare for SCWCD exam (CX-310-083) and upgrade exam (CX-310-084)
  • Learn the exam objectives specified by Sun Microsystems
  • Develop Java EE 5 compatible Web applications
  • Design and develop thread-safe servlets
  • Deploy secure Web applications
  • Use EL and JSTL
  • Unlock complexities of JavaServer Faces (JSF)

    The book includes a CD that contains JDK 6, Apache Ant 1.7 and Tomcat 5.5.26. These software are required for developing and running a Web application.
  • Book Reviews of Scwcd Exam Guide (covers Java Ee5)
    No Reviews Yet! Be the first one to review this book.

    Write your own book review for Scwcd Exam Guide (covers Java Ee5):
    Review Title:
    Your Name:

    Details of Book: Scwcd Exam Guide (covers Java Ee5) Book: Scwcd Exam Guide (covers Java Ee5)
    Author: Kunal Jaggi
    ISBN:

    0070249105


    ISBN-13:

    9780070249103

    ,

    978-0070249103


    Binding: Paperback
    Publishing Date: 2008
    Publisher: Tata Mgraw Hill
    2 States: The Story Of My Marriage by Chetan BhagatFourth book by the bestselling author Chetan Bhagat.
    2 States is a story about Krish and Ananya. They are from two different states of India, deeply in love and want to get married. Of course, their parents don’t agree. To convert their love story into a love marriage, the couple have a tough battle in front of them.

    Order now at 32% Discount
    Popular at Flipkart.comLineages Of Despotism And Development | Fugitive Denim | Chartered Schools | Nucleic Acids | South African Memories | Ethnography In Nursing Research | Networking Foundations | Ceramic Materials For Electronics, Third Edition | The Janissaries | On The Genealogy Of Morality | A History Of Painting | Steve Nash | Families In Many Cultures | American Women Spies Of World War Ii | Fifth Year Music | Florien | Children Of The Wild | Analisis Economico Aplicado A La Industria Petrolera. Tomo Ii | The Rifle And Hound In Ceylon | Netter's Essential Histology | National Interests Political Parties Mass Media Religion And Foreign Policy | The Master Key To Riches | Not Even Past | Trouting On The Brule River | Welfare And Rational Care | Banker To The Poor | Iznogoud | The Supremacy Of God In Preaching | Stay Hungry Stay Foolish | Satyarth Prakash | Eyelike Numbers See! Learn! Grow! | India Unbound | The Archaeology Of Hindu Ritual South Asian Edition | The Time Traveler's Wife | Customercentric Selling | India After Gandhi | The Hindus | Kashmir Article-370, 2002, 192pp | The New Market Wizards | Anna Karenina | Prime Obsession | English Opium-eater | Interview Questions In C++ Programming | Through The Grapevine | The Structure Of Scientific Revolutions | India After Gandhi- The History Of The World's Largest Democracy | Ignited Minds | Unveiling The Light In The Vedas | Iznogoud | Into The Wild | Hitman | Artist Management For The Music Business | The Outline Of History | Foundation | Quiver | more...


        Book: Scwcd Exam Guide (covers Java Ee5) by Kunal Jaggi
        ISBN Number: 0070249105, 9780070249103, 978-0070249103