This java programming site aims to provide book reviews and free ebook on java tutorial, java swing, sun java interface, java struts, java examples, java documentations, java j2ee, java jvm, java util, java j2se, java plugin, java programming, java runtime, java script, java downloads, free java applets, java vm, java certification, java socket, java beans, java source code, java threads, java help, java database, java api, java 1.5, java file, java training, java developments, java tips,java web services, etc

SCWCD: Web Component Developer Certification

This is a very useful SCWCD guide for SCWCD web component developer certification. Following are the exam objectives covered in this Java SCWCD exam preparation guide.
  • The HTTP methods
  • The HttpServletRequest interface
  • Using HttpServletResponse
  • The servlet life cycle
  • The file and directory structure of a web app
  • The deployment descriptor (web.xml)
  • The Deployment Descriptor structure
  • War files
  • The Web container model
  • Servlet Scopes and attributes
  • Requests and filters
  • Container life cycles and listeners
  • The RequestDispatcher mechanism
  • Storing objects in sessions
  • When sessions are created and destroyed
  • Session listeners
  • Session Management
  • Web Application Security
  • Security and the deployment descriptor
  • Comparing authentication types
  • JSP Elements
  • JSP directives
  • JSP with XML tags
  • The JSP lifecycle
  • JSP implicit objects
  • Configuring to use tag libraries
  • The include directive and standard action
  • EL and implicit variables
  • EL Arrays and collections
  • EL operators
  • EL Code that uses functions
  • JSP standard actions
  • The include, forward and param tags
  • Using tag libraries
  • Custom tags in JSP pages
  • Using the JSTL 1.1
  • Building custom tag libraries
  • PageContext, and tag handlers
  • Tags, parent tags and ancestors
  • Simple Tags
  • The tag file model
  • Design Patterns
Read More/Try It

The SCJP Handbook

By Witscale
With at least a dozen books on SCJP in the market, a question naturally arises is to why add one more? The Java certification assesses the conceptual knowledge and is not similar to academic or theoretical examinations. Hence purely academic approach may not work well for the exam. Therefore while following the SCJP syllabus, sufficient efforts must be put in to get true understanding of essential java concepts. There are many excellent books on SCJP and they are good enough for readers who know Java quite well. However they may be bit confusing for Java beginners. Since SCJP exam is particularly popular among Java beginners, this is an important issue. The SCJP Handbook tries to be different- While focusing on SCJP objectives—the assessment of important core Java concepts—it goes one step further—to discuss the concepts themselves.
When I started preparing for SCJP I knew only as much Java as needed for my work. Preparation for SCJP gave me an opportunity to experiment with several other interesting aspects of Java (threads for instance) and to learn “Java-as-a-language” from scratch. But while doing so I had gone through several books to truly get the picture of many Java concepts. It made me think to write a book on SCJP. I wrote this book because this was the book that I wanted to read when I started my SCJP preparation. I hope to make this book a one-stop-solution for SCJP.
Read More/Try It

SCBCD Study Guide

By Mikalai Zaikin
The purpose of this document is to help in preparation for exam CX-310-090 (Sun Certified Business Component Developer for the Java 2 Platform, Enterprise Edition 1.3). This document should not be used as the only study material for SCBCD test. It covers all objective topics, but it is not enough. I tried to make this document as much accurate as possible, but if you find any error, please let me know.
Following are the exam objectives covered in this SCBCD guide
  • EJB Overview: Identify the use, benefits, and characteristics of Enterprise JavaBeans technology, for version 2.0 of the EJB specification. Identify EJB 2.0 container requirements. Identify correct and incorrect statements or examples about EJB programming restrictions. Match EJB roles with the corresponding description of the role's responsibilities, where the description may include deployment descriptor information. Given a list, identify which are requirements for an EJB-jar file.
  • Client View of a Session Bean: Identify correct and incorrect statements or examples about the client view of a session bean's local and remote home interfaces, including the code used by a client to locate a session bean's home interface. Identify correct and incorrect statements or examples about the client view of a session bean's local and remote component interfaces.
  • Session Bean Component Contract: Identify correct and incorrect statements or examples about session beans, including conversational state, the SessionBean interface, and create methods. Identify the use and the behavior of the ejbPassivate method in a session bean, including the responsibilities of both the container and the bean provider. Identify the interface and method for each of the following: retrieve the session bean's remote home interface, retrieve the session bean's local component interface, determine if the session bean's caller has a particular role, allow the instance to mark the current transaction as a rollback, retrieve the UserTransaction interface, prepare the instance for reuse following passivation, release resources prior to removal, identify the invoker of the bean instance's component interface, be notified that a new transaction has begun, and be notified that the current transaction has completed. Match the correct description about purpose and function to which session bean type they apply: stateless, stateful, or both. Given a list of responsibilities related to session beans, identify those which are the responsibility of the session bean provider and those which are the responsibility of the EJB container provider. Given a list of requirements, identify those which are the requirements for a session bean class, a remote component interface, a remote home interface, create methods, business methods, a local component interface, and a local home interface.
  • Session Bean Life Cycle: Identify correct and incorrect statements or examples about the life cycle of a stateful or stateless session bean instance. Given a list of methods for a stateful or stateless session bean class, define which of the following operations can be performed from each of those methods: SessionContext interface methods, UserTransaction methods, Java Naming and Directory Interface API (JNDI API) access to java:comp/env environment naming context, resource manager access, and other enterprise bean access. Given a list of scenarios, identify which will result in an ejbRemove method not being called on a bean instance.
  • Client View of an Entity: Identify correct and incorrect statements or examples about the client of an entity bean's local and remote home interface, including viewing the code used to locate an entity bean's home interface and the home interface methods provided to the client. Identify correct and incorrect statements or examples about the client view of an entity bean's local component interface (EJBLocalObject). Identify correct and incorrect statements or examples about the client view of a entity bean's remote component interface (EJBObject). Identify the use, syntax, and behavior of, the following entity bean home method types, for Container-Managed Persistence (CMP); finder methods, create methods, remove methods, and home methods.
  • Component Contract for Container-Managed Persistence (CMP): Identify correct and incorrect statements or examples about the entity bean provider's view and programming contract for CMP, including the requirements for a CMP entity bean. Identify correct and incorrect statements or examples about persistent relationships, remove protocols, and about the abstract schema type of a CMP entity bean. Identify correct and incorrect statements or examples about the rules and semantics for relationship assignment and relationship updating in a CMP bean. Match the name with a description of purpose or functionality, for each of the following deployment descriptor elements: ejb-name, abstract-schema-name, ejb-relation, ejb-relationship-role, cmr-field, cmr-field-type, and relationship-role-source. Identify correctly-implemented deployment descriptor elements for a CMP bean (including container-managed relationships). Identify the interfaces and methods a CMP entity bean must and must not implement.
  • CMP Entity Bean Life Cycle : Identify correct and incorrect statements or examples about the life cycle of a CMP entity bean. From a list, identify the purpose, behavior, and responsibilities of the bean provider for a CMP entity bean, including but not limited to: setEntityContext, unsetEntityContext, ejbCreate, ejbPostCreate, ejbActivate, ejbPassivate, ejbRemove, ejbLoad, ejbStore, ejbFind, ejbHome, and ejbSelect. From a list, identify the responsibility of the container for a CMP entity bean, including but not limited to: setEntityContext, unsetEntityContext, ejbCreate, ejbPostCreate, ejbActivate, ejbPassivate, ejbRemove, ejbLoad, ejbStore, ejbFind, ejbHome, and ejbSelect.
  • Entity Beans: From a list of behaviors, match them with the appropriate EntityContext method responsible for that behavior. Identify correct and incorrect statements or examples about an entity bean's primary key and object identity.
  • EJB-QL: Identify correct and incorrect syntax for an EJB QL query including the SELECT, FROM, and WHERE clauses. Identify correct and incorrect statements or examples about the purpose and use of EJB QL. Identify correct and incorrect conditional expressions, BETWEEN expressions, IN expressions, LIKE expressions, and comparison expressions.
  • Message-Driven Bean Component Contract: Identify correct and incorrect statements or examples about the client view of a message-driven bean, and the life cycle of a message-driven bean. Identify the interfaces and methods a JMS message-driven bean must implement. Identify the use and behavior of the MessageDrivenContext interface methods. From a list, identify the responsibility of the bean provider and the responsibility of the container provider for a message-driven bean.
  • Transactions: Identify correct and incorrect statements or examples about EJB transactions, including bean-managed transaction demarcation and container-managed transaction demarcation. Identify correct and incorrect statements about the Application Assembler's responsibilities, including the use of deployment descriptor elements related to transactions and the identification of the methods of a particular bean type for which a transaction attribute must be specified. Given a list of transaction behaviors, match them with the appropriate transaction attributes. Given a list of responsibilities, identify whose which are the Container's with respect to transactions, including the handling of getRollbackOnly, setRollbackOnly, getUserTransaction, SessionSynchronzation callbacks, for both container and bean-managed transactions.
  • Exceptions: Identify correct and incorrect statements or examples about exception handling in EJB. Given a list of responsibilities related to exceptions, identify those which are the bean provider's, and those which are the responsibility of the container provider. Be prepared to recognize responsibilities for which neither the bean provider or the container provider are responsible. Identify correct and incorrect statements or examples about application exceptions and system exceptions in entity beans, session beans, and message-driven beans. Given a particular method condition, identify the following: whether an exception will be thrown, the type of exception thrown, the container's action, and the client's view. Identify correct and incorrect statements or examples about the client's view of exceptions received from an enterprise bean invocation.
  • Enterprise Bean Environment: Identify correct and incorrect statements or examples about an enterprise bean's environment JNDI API naming. Identify correct and incorrect statements about the purpose and use of the deployment descriptor elements for environment entries, EJB references, and resource manager connection factory references; including whether a given code listing is appropriate and correct with respect to a particular deployment descriptor element. Given a list of responsibilities, identify which belong to the deployer, bean provider, application assembler, container provider, system administrator, or any combination.
  • Security Management: Identify correct and incorrect statements about the EJB support for security management including security roles, security role references, and method permissions. From a list of responsibilities, identify which belong to the application assembler, bean provider, deployer, container provider, or system administrator.Given a code listing, determine whether it is a legal and appropriate way to programmatically access a caller's security context. Given a security-related deployment descriptor tag, identify correct and incorrect statements and code related to that tag.
Read More/Try It

SCDJWS Study Guide

By Mikalai Zaikin
The purpose of this document is to help in preparation for exam CX-310-220 (Sun Certified Developer for Java Web Services). This document should NOT be used as the only study material for SCDJWS (Sun Certified Developer for Java Web Services) Test. It does NOT covers all objective topics. I tried to make this document as much accurate as possible, but if you find any error, please let me know.
Following are the exam objectives covered in this SCDJWS study guide.
  • XML Web Service Standards: Given XML documents, schemas, and fragments determine whether their syntax and form are correct (according to W3C schema) and whether they conform to the WS-I Basic Profile 1.0a. Describe the use of XML Schema in J2EE Web services. Describe the use of namespaces in an XML document.
  • SOAP 1.1 Web Service Standards: List and describe the encoding types used in a SOAP message. Describe how SOAP message header blocks are used and processed. Describe the function of each element contained in a SOAP message, the SOAP binding to HTTP, and how to represent faults that occur when processing a SOAP message. Create a SOAP message that contains an attachment. Describe the restrictions placed on the use of SOAP by the WS-I Basic Profile 1.0a. Describe the function of SOAP in a Web service interaction and the advantages and disadvantages of using SOAP messages.
  • Describing and Publishing (WSDL and UDDI): Explain the use of WSDL in Web services, including a description of WSDL's basic elements, binding mechanisms and the basic WSDL operation types as limited by the WS-I Basic Profile 1.0a. Describe how W3C XML Schema is used as a typing mechanism in WSDL 1.1. Describe the use of UDDI data structures. Consider the requirements imposed on UDDI by the WS-I Basic Profile 1.0a. Describe the basic functions provided by the UDDI Publish and Inquiry APIs to interact with a UDDI business registry.
  • JAX-RPC: Explain the service description model, client connection types, interaction modes, transport mechanisms/protocols, and endpoint types as they relate to JAX-RPC. Given a set of requirements for a Web service, such as transactional needs, and security requirements, design and develop Web service applications that use servlet-based endpoints and EJB based endpoints. Given an set of requirements, design and develop a Web sevice client, such as a J2EE client and a stand-alone Java client, using the appropriate JAX-RPC client connection style. Given a set of requirements, develop and configure a Web service client that accesses a stateful Web service. Explain the advantages and disadvantages of a WSDL to Java vs. a Java to WSDL development approach. Describe the advantages and disadvantages of web service applications that use either synchronous/request response, one-way RPC, or non-blocking RPC invocation modes. Use the JAX-RPC Handler API to create a SOAP message handler, describe the function of a handler chain, and describe the role of SAAJ when creating a message handler.
  • SOAP and XML Processing APIs (JAXP, JAXB, and SAAJ): Describe the functions and capabilities of the APIs included within JAXP. Given a scenario, select the proper mechanism for parsing and processing the information in an XML document. Describe the functions and capabilities of JAXB, including the JAXB process flow, such as XML-to-Java and Java-to-XML, and the binding and validation mechanisms provided by JAXB. Use the SAAJ APIs to create and manipulate a SOAP message.
  • JAXR: Describe the function of JAXR in Web service architectural model, the two basic levels of business registry functionality supported by JAXR, and the function of the basic JAXR business objects and how they map to the UDDI data structures. Use JAXR to connect to a UDDI business registry, execute queries to locate services that meet specific requirements, and publish or update information about a business service.
  • J2EE Web Services: Identify the characteristics of and the services and APIs included in the J2EE platform. Explain the benefits of using the J2EE platform for creating and deploying Web service applications. Describe the functions and capabilities of the JAXP, DOM, SAX, JAXR, JAX-RPC, and SAAJ in the J2EE platform. Describe the role of the WS-I Basic Profile when designing J2EE Web services.
  • Security: Explain basic security mechanisms including: transport level security, such as basic and mutual authentication and SSL, message level security, XML encryption, XML Digital Signature, and federated identity and trust. Identify the purpose and benefits of Web services security oriented initiatives and standards such as Username Token Profile, SAML, XACML, XKMS, WS-Security, and the Liberty Project. Given a scenario, implement J2EE based web service web-tier and/or EJB-tier basic security mechanisms, such as mutual authentication, SSL, and access control. Describe factors that impact the security requirements of a Web service, such as the relationship between the client and service provider, the type of data being exchanged, the message format, and the transport mechanism.
  • Developing Web Services: Describe the steps required to configure, package, and deploy J2EE Web services and service clients, including a description of the packaging formats, such as .ear, .war, .jar, deployment descriptor settings, the associated Web Services description file, RPC mapping files, and service reference elements used for EJB and servlet endpoints. Given a set of requirements, develop code to process XML files using the SAX, DOM, XSLT, and JAXB APIs. Given an XML schema for a document style Web service create a WSDL file that describes the service and generate a service implementation. Given a set of requirements, develop code to create an XML-based, document style, Web service using the JAX-RPC APIs. Implement a SOAP logging mechanism for testing and debugging a Web Service application using J2EE Web Service APIs. Given a set of requirements, develop code to handle system and service exceptions and faults received by a Web services client.
  • General Design and Architecture: Describe the characteristics of a service oriented architecture and how Web Services fits to this model. Given a scenario, design a J2EE service using the Business Delegate, Service Locator, and/or Proxy client-side design patterns and the Adapter, Command, Web Service Broker, and/or Façade server-side patterns. Describe alternatives for dealing with issues that impact the quality of service provided by a Web service and methods to improve the system reliability, maintainability, security, and performance of a service. Describe how to handle the various types of return values, faults, errors, and exceptions that can occur during a Web service interaction. Describe the role that Web services play when integrating data, application functions, or business processes in a J2EE application. Describe how to design a stateless Web service that exposes the functionality of a stateful business process.
  • Endpoint Design and Architecture: Given a scenario, design Web service applications using information models that are either procedure-style or document-style. Describe the function of the service interaction and processing layers in a Web service. Describe the tasks performed by each phase of an XML-based, document oriented, Web service application, including the consumption, business processing, and production phases. Design a Web service for an asynchronous, document-style process and describe how to refactor a Web service from a synchronous to an asynchronous model. Describe how the characteristics, such as resource utilization, conversational capabilities, and operational modes, of the various types of Web service clients impact the design of a Web service or determine the type of client that might interact with a particular service.
Read More/Try It

SCJP Tiger Study Guide

By Mikalai Zaikin

The purpose of this document is to help in preparation for exam CX-310-055 (Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0). This document should not be used as the only study material for SCJP Tiger (Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0) Test. It covers mostly Java 5.0-specific objectives. I tried to make this document as much accurate as possible, but if you find any error, please let me know.

Following are the exam objectives covered in this SCJP study guide

  • Declarations, Initialization and Scoping: Develop code that declares classes (including abstract and all forms of nested classes), interfaces, and enums, and includes the appropriate use of package and import statements (including static imports). Develop code that declares an interface. Develop code that implements or extends one or more interfaces. Develop code that declares an abstract class. Develop code that extends an abstract class. Develop code that declares, initializes, and uses primitives, arrays, enums, and objects as static, instance, and local variables. Also, use legal identifiers for variable names. Develop code that declares both static and non-static methods, and - if appropriate - use method names that adhere to the JavaBeans naming standards. Also develop code that declares and uses a variable-length argument list. Given a code example, determine if a method is correctly overriding or overloading another method, and identify legal return values (including covariant returns), for the method. Given a set of classes and superclasses, develop constructors for one or more of the classes. Given a class declaration, determine if a default constructor will be created, and if so, determine the behavior of that constructor. Given a nested or non-nested class listing, write code to instantiate the class.
  • Flow Control: Develop code that implements an if or switch statement; and identify legal argument types for these statements. Develop code that implements all forms of loops and iterators, including the use of for, the enhanced for loop (for-each), do, while, labels, break, and continue; and explain the values taken by loop counter variables during and after loop execution. Develop code that makes use of assertions, and distinguish appropriate from inappropriate uses of assertions. Develop code that makes use of exceptions and exception handling clauses (try, catch, finally), and declares methods and overriding methods that throw exceptions. Recognize the effect of an exception arising at a specified point in a code fragment. Note that the exception may be a runtime exception, a checked exception, or an error. Recognize situations that will result in any of the following being thrown: ArrayIndexOutOfBoundsException, ClassCastException, IllegalArgumentException, IllegalStateException, NullPointerException, NumberFormatException, AssertionError, ExceptionInInitializerError, StackOverflowError or NoClassDefFoundError. Understand which of these are thrown by the virtual machine and recognize situations in which others should be thrown programatically.
  • API Contents: Develop code that uses the primitive wrapper classes (such as Boolean, Character, Double, Integer, etc.), and/or autoboxing & unboxing. Discuss the differences between the String, StringBuilder, and StringBuffer classes. Given a scenario involving navigating file systems, reading from files, or writing to files, develop the correct solution using the following classes (sometimes in combination), from java.io: BufferedReader, BufferedWriter, File, FileReader, FileWriter and PrintWriter. Develop code that serializes and/or de-serializes objects using the following APIs from java.io: DataInputStream, DataOutputStream, FileInputStream, FileOutputStream, ObjectInputStream, ObjectOutputStream and Serializable. Use standard J2SE APIs in the java.text package to correctly format or parse dates, numbers, and currency values for a specific locale; and, given a scenario, determine the appropriate methods to use if you want to use the default locale or a specific locale. Describe the purpose and use of the java.util.Locale class. Write code that uses standard J2SE APIs in the java.util and java.util.regex packages to format or parse strings or streams. For strings, write code that uses the Pattern and Matcher classes and the String.split(...) method. Recognize and use regular expression patterns for matching (limited to: . (dot), * (star), + (plus), ?, \d, \s, \w, [], ()). The use of *, +, and ? will be limited to greedy quantifiers, and the parenthesis operator will only be used as a grouping mechanism, not for capturing content during matching. For streams, write code using the Formatter and Scanner classes and the PrintWriter.format/printf methods. Recognize and use formatting parameters (limited to: %b, %c, %d, %f, %s) in format strings.
  • Concurrency: Write code to define, instantiate, and start new threads using both java.lang.Thread and java.lang.Runnable. Recognize the states in which a thread can exist, and identify ways in which a thread can transition from one state to another. Given a scenario, write code that makes appropriate use of object locking to protect static or instance variables from concurrent access problems. Given a scenario, write code that makes appropriate use of wait, notify, or notifyAll.
  • OO Concepts: Develop code that implements tight encapsulation, loose coupling, and high cohesion in classes, and describe the benefits. Given a scenario, develop code that demonstrates the use of polymorphism. Further, determine when casting will be necessary and recognize compiler vs. runtime errors related to object reference casting. Explain the effect of modifiers on inheritance with respect to constructors, instance or static variables, and instance or static methods. Given a scenario, develop code that declares and/or invokes overridden or overloaded methods and code that declares and/or invokes superclass, overridden, or overloaded constructors. Develop code that implements "is-a" and/or "has-a" relationships.
  • Collections / Generics: Given a design scenario, determine which collection classes and/or interfaces should be used to properly implement that design, including the use of the Comparable interface. Distinguish between correct and incorrect overrides of corresponding hashCode and equals methods, and explain the difference between == and the equals method. Write code that uses the generic versions of the Collections API, in particular, the Set, List, Queue and Map interfaces and implementation classes. Recognize the limitations of the non-generic Collections API and how to refactor code to use the generic versions. Develop code that makes proper use of type parameters in class/interface declarations, instance variables, method arguments, and return types; and write generic methods or methods that make use of wildcard types and understand the similarities and differences between these two approaches. Use capabilities in the java.util package to write code to manipulate a list by sorting, performing a binary search, or converting the list to an array. Use capabilities in the java.util package to write code to manipulate an array by sorting, performing a binary search, or converting the array to a list. Use the java.util.Comparator and java.lang.Comparable interfaces to affect the sorting of lists and arrays. Furthermore, recognize the effect of the "natural ordering" of primitive wrapper classes and java.lang.String on sorting.
  • Fundamentals: Given a code example and a scenario, write code that uses the appropriate access modifiers, package declarations, and import statements to interact with (through access or inheritance) the code in the example. Given an example of a class and a command-line, determine the expected runtime behavior. Determine the effect upon object references and primitive values when they are passed into methods that perform assignments or other modifying operations on the parameters. Given a code example, recognize the point at which an object becomes eligible for garbage collection, and determine what is and is not guaranteed by the garbage collection system. Recognize the behaviors of System.gc and finalization. Given the fully-qualified name of a class that is deployed inside and/or outside a JAR file, construct the appropriate directory structure for that class. Given a code example and a classpath, determine whether the classpath will allow the code to compile successfully. Write code that correctly applies the appropriate operators including assignment operators (limited to: =, +=, -=), arithmetic operators (limited to: +, -, *, /, %, ++, --), relational operators (limited to: <, <=, >, >=, ==, !=), the instanceof operator, logical operators (limited to: &, |, ^, !, &&, ||), and the conditional operator ( ? : ), to produce a desired result. Write code that determines the equality of two objects or two primitives.
Read More/Try It

SCBCD 5.0 Study Guide

By Mikalai Zaikin
The purpose of this document is to help in preparation for exam CX-310-091 (Sun Certified Business Component Developer for Java EE 5.0). This document should not be used as the only study material for SCBDC 5.0 test. It covers all objective topics, but it is not enough. I tried to make this document as much accurate as possible, but if you find any error, please let me know.
  • EJB 3.0 Overview: Identify the uses, benefits, and characteristics of Enterprise JavaBeans technology, for version 3.0 of the EJB specification. Identify the APIs that all EJB 3.0 containers must make available to developers. Identify correct and incorrect statements or examples about EJB programming restrictions. Match the seven EJB roles with the corresponding description of the role's responsibilities. Describe the packaging and deployment requirements for enterprise beans. Describe the purposes and uses of annotations and deployment descriptors, including how the two mechanisms interact, how overriding is handled, and how these mechanisms function at the class, method, and field levels.
  • General EJB 3.0 Enterprise Bean Knowledge: Identify correct and incorrect statements or examples about the lifecycle of all 3.0 Enterprise Bean instances, including the use of the @PostConstruct and @PreDestroy callback methods. Identify correct and incorrect statements or examples about interceptors, including implementing an interceptor class, the lifecycle of interceptor instances, @AroundInvoke methods, invocation order, exception handling, lifecycle callback methods, default and method level interceptors, and specifying interceptors in the deployment descriptor. Identify correct and incorrect statements or examples about how enterprise beans declare dependencies on external resources using JNDI or dependency injection, including the general rules for using JNDI, annotations and/or deployment descriptors, EJB references, connection factories, resource environment entries, and persistence context and persistence unit references. Identify correct and incorrect statements or examples about Timer Services, including the bean provider's view and responsibilities, the TimerService, Timer and TimerHandle interfaces, and @Timeout callback methods. Identify correct and incorrect statements or examples about the EJB context objects that the container provides to 3.0 Session beans and 3.0 Message-Driven beans, including the security, transaction, timer, and lookup services the context can provide. Identify correct and incorrect statements or examples about EJB 3.0 / EJB 2.x interoperability, including how to adapt an EJB 3.0 bean for use with clients written to the EJB 2.x API and how to access beans written to the EJB 2.x API from beans written to the EJB 3.0 API.
  • EJB 3.0 Session Bean Component Contract & Lifecycle: Identify correct and incorrect statements or examples that compare the purpose and use of Stateful and Stateless Session Beans. Identify correct and incorrect statements or examples about remote and local business interfaces for Session Beans. Write code for the bean classes of Stateful and Stateless Session Beans. Identify correct and incorrect statements or examples about the lifecycle of a Stateful Session Bean including the PrePassivate and PostActivate lifecycle callback methods and @Remove methods. Given a list of methods of a Stateful or Stateless Session Bean class, define which of the following operations can be performed from each of those methods: SessionContext interface methods, UserTransaction methods, access to the java:comp/env environment naming context, resource manager access, and other enterprise bean access. Identify correct and incorrect statements or examples about implementing a session bean as a web service endpoint, including rules for writing a web service endpoint interface and use of the @WebService and @WebMethod annotations. Identify correct and incorrect statements or examples about the client view of a session bean, including the client view of a session object's life cycle, obtaining and using a session object, and session object identity.
  • EJB 3.0 Message-Driven Bean Component Contract: Develop code that implements a Message-Driven Bean Class. Identify correct and incorrect statements or examples about the interface(s) and methods a JMS Message-Driven bean must implement, and the required metadata. Describe the use and behavior of a JMS message driven bean, including concurrency of message processing, message redelivery, and message acknowledgement. Identify correct and incorrect statements or examples about the client view of a message driven bean.
  • Java Persistence API Entities: Identify correct and incorrect statements or examples about the characteristics of Java Persistence entities. Develop code to create valid entity classes, including the use of fields and properties, admissible types, and embeddable classes. Identify correct and incorrect statements or examples about primary keys and entity identity, including the use of compound primary keys. Implement association relationships using persistence entities, including the following associations: bidirectional for @OneToOne, @ManyToOne, @OneToMany, and @ManyToMany; unidirectional for @OneToOne, @ManyToOne, @OneToMany, and @ManyToMany. Given a set of requirements and entity classes choose and implement an appropriate object-relational mapping for association relationships. Given a set of requirements and entity classes, choose and implement an appropriate inheritance hierarchy strategy and/or an appropriate mapping strategy. Describe the use of annotations and XML mapping files, individually and in combination, for object-relational mapping.
  • Java Persistence Entity Operations: Describe how to manage entities, including using the EntityManager API and the cascade option. Identify correct and incorrect statements or examples about entity instance lifecycle, including the new, managed, detached, and removed states. Identify correct and incorrect statements or examples about EntityManager operations for managing an instance's state, including eager/lazy fetching, handling detached entities, and merging detached entities. Identify correct and incorrect statements or examples about Entity Listeners and Callback Methods, including: @PrePersist, @PostPersist, @PreRemove, @PostRemove, @PreUpdate, @PostUpdate, and @PostLoad, and when they are invoked. Identify correct and incorrect statements about concurrency, including how it is managed through the use of @Version attributes and optimistic locking.
  • Persistence Units and Persistence Contexts: Identify correct and incorrect statements or examples about JTA and resource-local entity managers. Identify correct and incorrect statements or examples about container-managed persistence contexts. Identify correct and incorrect statements or examples about application-managed persistence contexts. Identify correct and incorrect statements or examples about transaction management for persistence contexts, including persistence context propagation, the use of the EntityManager.joinTransaction() method, and the EntityTransaction API. Identify correct and incorrect statements or examples about persistence units, how persistence units are packaged, and the use of the persistence.xml file. Identify correct and incorrect statements or examples about the effect of persistence exceptions on transactions and persistence contexts.
  • Java Persistence Query Language: Develop queries that use the SELECT clause to determine query results, including the use of entity types, use of aggregates, and returning multiple values. Develop queries that use Java Persistence Query Language syntax for defining the domain of a query using JOIN clauses, IN, and prefetching. Use the WHERE clause to restrict query results using conditional expressions, including the use of literals, path expressions, named and positional parameters, logical operators, the following expressions (and their NOT options): BETWEEN, IN, LIKE, NULL, EMPTY, MEMBER [OF], EXISTS, ALL, ANY, SOME, and functional expressions. Develop Java Persistence Query Language statements that update a set of entities using UPDATE/SET and DELETE FROM. Declare and use named queries, dynamic queries, and SQL (native) queries. Obtain javax.persistence.Query objects and use the javax.persistence.Query API.
  • Transactions: Identify correct and incorrect statements or examples about bean-managed transaction demarcation. Identify correct and incorrect statements or examples about container-managed transaction demarcation, and given a list of transaction behaviors, match them with the appropriate transaction attribute. Identify correct and incorrect statements or examples about transaction propagation semantics. Identify correct and incorrect statements or examples about specifying transaction information via annotations and/or deployment descriptors. Identify correct and incorrect statements or examples about the use of the EJB API for transaction management, including getRollbackOnly, setRollbackOnly and the SessionSynchronization interfaces.
  • Exceptions: Identify correct and incorrect statements or examples about exception handling in EJB. Identify correct and incorrect statements or examples about application exceptions and system exceptions in session beans and message-driven beans, and defining a runtime exception as an application exception. Given a list of responsibilities related to exceptions, identify those which are the bean provider's, and those which are the responsibility of the container provider. Be prepared to recognize responsibilities for which neither the bean nor container provider is responsible. Identify correct and incorrect statements or examples about the client's view of exceptions received from an enterprise bean invocation. Given a particular method condition, identify the following: whether an exception will be thrown, the type of exception thrown, the container's action, and the client's view.
  • Security Management: Match security behaviors to declarative security specifications (default behavior, security roles, security role references, and method permissions). From a list of responsibilities, identify which roles are responsible for which aspects of security: application assembler, bean provider, deployer, container provider, system administrator, or server provider. Identify correct and incorrect statements or examples about use of the isCallerInRole and getCallerPrincipal EJB programmatic security APIs. Given a security-related deployment descriptor tag or annotation, identify correct and incorrect statements and/or code related to that tag.
Read More/Download

SCEA 5 Study Guide

By Mikalai Zaikin

The purpose of this document is to help in preparation for exam 310-052 (Sun Certified Enterprise Architect for Java EE 5).This document should not be used as the only study material for SCEA 5 test. It covers all objective topics, but it is not enough. I tried to make this document as much accurate as possible, but if you find any error, please let me know.

Following are the exam objective covered in this SCEA 5 study guide.
  • Application Design Concepts and Principles: Explain the main advantages of an object oriented approach to system design including the effect of encapsulation, inheritance, delegation, and the use of interfaces, on architectural characteristics. Describe how the principle of "separation of concerns" has been applied to the main system tiers of a Java EE application. Tiers include client (both GUI and web), web (web container), business (EJB container), integration, and resource tiers. Describe how the principle of "separation of concerns" has been applied to the layers of a Java EE application. Layers include application, virtual platform (component APIs), application infrastructure (containers), enterprise services (operating system and virtualization), compute and storage, and the networking infrastructure layers.
  • Common Architectures: Explain the advantages and disadvantages of two tier architectures when examined under the following topics: scalability, maintainability, reliability, availability, extensibility, performance, manageability, and security. Explain the advantages and disadvantages of three tier architectures when examined under the following topics: scalability, maintainability, reliability, availability, extensibility, performance, manageability, and security. Explain the advantages and disadvantages of multi-tier architectures when examined under the following topics: scalability, maintainability, reliability, availability, extensibility, performance, manageability, and security. Explain the benefits and drawbacks of rich clients and browser-based clients as deployed in a typical Java EE application. Explain appropriate and inappropriate uses for Web Services in the Java EE Platform.
  • Integration and Messaging: Explain possible approaches for communicating with an external system from a Java EE-based system given an outline description of those systems and outline the benefits and drawbacks of each approach. Explain typical uses of Web Services and XML over HTTP as mechanisms to integrate distinct software components. Explain how Java Connector Architecture and JMS are used to integrate distinct software components as part of an overall Java EE application.
  • Business Tier Technologies: Explain and contrast uses for Entity Beans, Entity Classes, Stateful and Stateless Session Beans, and Message Driven Beans and understand the advantages and disadvantages of each type. Explain and contrast the following persistence strategies: Container Managed Persistence (CMP) BMP, JDO, JPA, ORM and using DAOs (Data Access Objects) and direct JDBC-based persistence under the following headings: ease of development, performance, scalability, extensibility and security. Explain how Java EE supports the deployment of server-side components implemented as Web Services and the advantages and disadvantages of adopting such an approach. Explain the benefits of the EJB3 development model over previous EJB generations for ease of development including how the EJB container simplifies EJB development.
  • Web Tier Technologies: State the benefits and drawbacks of adopting a web framework in designing a Java EE application. Explain standard uses for JSP and Servlet technologies in a typical Java EE application. Explain standard uses for JSF technology in a typical Java EE application. Given a system requirements definition, explain and justify your rationale for choosing a web-centric or EJB-centric implementation to solve the requirements. Web-centric means that you are providing a solution that does not use EJBs. EJB-centric solution will require an application server that supports EJBs.
  • Applicability of Java EE Technology: Given a specified business problem, design a modular solution implemented using Java EE which solves that business problem. Explain how the Java EE platform enables service oriented architecture (SOA) -based applications. Explain how you would design a Java EE application to repeatedly measure critical non-functional requirements and outline a standard process with specific strategies to refactor that application to improve on the results of the measurements.
  • Patterns: From a list, select the most appropriate pattern for a given scenario. Patterns are limited to those documented in the book - Alur, Crupi and Malks (2003). Core J2EE Patterns: Best Practices and Design Strategies 2nd Edition and named using the names given in that book. From a list, select the most appropriate pattern for a given scenario. Patterns are limited to those documented in the book - Gamma, Erich; Richard Helm, Ralph Johnson, and John Vlissides (1995). Design Patterns: Elements of Reusable Object-Oriented Software and are named using the names given in that book. Select from a list the benefits and drawbacks of a pattern drawn from the book - Gamma, Erich; Richard Helm, Ralph Johnson, and John Vlissides (1995). Design Patterns: Elements of Reusable Object-Oriented Software. Select from a list the benefits and drawbacks of a specified Core J2EE pattern drawn from the book - Alur, Crupi and Malks (2003). Core J2EE Patterns: Best Practices and Design Strategies 2nd Edition.
  • Security: Explain the client-side security model for the Java SE environment, including the Web Start and applet deployment modes. Given an architectural system specification, select appropriate locations for implementation of specified security features, and select suitable technologies for implementation of those features. Identify and classify potential threats to a system and describe how a given architecture will address the threats. Describe the commonly used declarative and programmatic methods used to secure applications built on the Java EE platform, for example use of deployment descriptors and JAAS.
Read More/Try It

SCWCD 1.4 Study Guide

By Mikalai Zaikin

The purpose of this document is to help in preparation for exam CX-310-081 (Sun Certified Web Component Developer using the J2EE Platform 1.4). This document should not be used as the only study material for SCWCD 1.4 test. It covers all objective topics, but it is not enough. I tried to make this document as much accurate as possible, but if you find any error, please let me know.
Following are the exam objectives covered in this SCWCD study guide.
  • The Servlet Technology Model: For each of the HTTP Methods (such as GET, POST, HEAD, and so on) describe the purpose of the method and the technical characteristics of the HTTP Method protocol, list triggers that might cause a Client (usually a Web browser) to use the method; and identify the HttpServlet method that corresponds to the HTTP Method. Using the HttpServletRequest interface, write code to retrieve HTML form parameters from the request, retrieve HTTP request header information, or retrieve cookies from the request. Using the HttpServletResponse interface, write code to set an HTTP response header, set the content type of the response, acquire a text stream for the response, acquire a binary stream for the response, redirect an HTTP request to another URL, or add cookies to the response. Describe the purpose and event sequence of the servlet life cycle: (1) servlet class loading, (2) servlet instantiation, (3) call the init method, (4) call the service method, and (5) call destroy method.
  • The Structure and Deployment of Web Applications: Construct the file and directory structure of a Web Application that may contain (a) static content, (b) JSP pages, (c) servlet classes, (d) the deployment descriptor, (e) tag libraries, (f) JAR files, and (g) Java class files; and describe how to protect resource files from HTTP access. Describe the purpose and semantics for each of the following deployment descriptor elements: error-page, init-param, mime-mapping, servlet, servlet-class, servlet-mapping, servlet-name, and welcome-file. Construct the correct structure for each of the following deployment descriptor elements: error-page, init-param, mime-mapping, servlet, servlet-class, servlet-mapping, servlet-name, and welcome-file. Explain the purpose of a WAR file and describe the contents of a WAR file, how one may be constructed.
  • The Web Container Model: For the ServletContext initialization parameters: write servlet code to access initialization parameters; and create the deployment descriptor elements for declaring initialization parameters. For the fundamental servlet attribute scopes (request, session, and context): write servlet code to add, retrieve, and remove attributes; given a usage scenario, identify the proper scope for an attribute; and identify multi-threading issues associated with each scope. Describe the Web container request processing model; write and configure a filter; create a request or response wrapper; and given a design problem, describe how to apply a filter or a wrapper. Describe the Web container life cycle event model for requests, sessions, and web applications; create and configure listener classes for each scope life cycle; create and configure scope attribute listener classes; and given a scenario, identify the proper attribute listener to use.Describe the RequestDispatcher mechanism; write servlet code to create a request dispatcher; write servlet code to forward or include the target resource; and identify and describe the additional request-scoped attributes provided by the container to the target resource.
  • Session Management: Write servlet code to store objects into a session object and retrieve objects from a session object. Given a scenario describe the APIs used to access the session object, explain when the session object was created, and describe the mechanisms used to destroy the session object, and when it was destroyed. Using session listeners, write code to respond to an event when an object is added to a session, and write code to respond to an event when a session object migrates from one VM to another. Given a scenario, describe which session management mechanism the Web container could employ, how cookies might be used to manage sessions, how URL rewriting might be used to manage sessions, and write servlet code to perform URL rewriting.
  • Web Application Security: Based on the servlet specification, compare and contrast the following security mechanisms: (a) authentication, (b) authorization, (c) data integrity, and (d) confidentiality. In the deployment descriptor, declare a security constraint, a Web resource, the transport guarantee, the login configuration, and a security role. Compare and contrast the authentication types (BASIC, DIGEST, FORM, and CLIENT-CERT); describe how the type works; and given a scenario, select an appropriate type.
  • The JavaServer Pages (JSP) Technology Model: Identify, describe, or write the JSP code for the following elements: (a) template text, (b) scripting elements (comments, directives, declarations, scriptlets, and expressions), (c) standard and custom actions, and (d) expression language elements. Write JSP code that uses the directives: (a) 'page' (with attributes 'import', 'session', 'contentType', and 'isELIgnored'), (b) 'include', and (c) 'taglib'. Write a JSP Document (XML-based document) that uses the correct syntax. Describe the purpose and event sequence of the JSP page life cycle: (1) JSP page translation, (2) JSP page compilation, (3) load class, (4) create instance, (5) call the jspInit method, (6) call the _jspService method, and (7) call the jspDestroy method. Given a design goal, write JSP code using the appropriate implicit objects: (a) request, (b) response, (c) out, (d) session, (e) config, (f) application, (g) page, (h) pageContext, and (i) exception. Configure the deployment descriptor to declare one or more tag libraries, deactivate the evaluation language, and deactivate the scripting language. Given a specific design goal for including a JSP segment in another page, write the JSP code that uses the most appropriate inclusion mechanism (the include directive or the jsp:include standard action).
  • Building JSP Pages Using the Expression Language (EL): Given a scenario, write EL code that accesses the following implicit variables including: pageScope, requestScope, sessionScope, and applicationScope, param and paramValues, header and headerValues, cookie, initParam and pageContext. Given a scenario, write EL code that uses the following operators: property access (the '.' operator), collection access (the '[]' operator). Given a scenario, write EL code that uses the following operators: aritmetic operators, relational operators, and logical operators. Given a scenario, write EL code that uses a function; write code for an EL function; and configure the EL function in a tag library descriptor.
  • Building JSP Pages Using Standard Actions: Given a design goal, create a code snippet using the following standard actions: jsp:useBean (with attributes: 'id', 'scope', 'type', and 'class'), jsp:getProperty, and jsp:setProperty (with all attribute combinations). Given a design goal, create a code snippet using the following standard actions: jsp:include, jsp:forward, and jsp:param.
  • Building JSP Pages Using Tag Libraries: For a custom tag library or a library of Tag Files, create the 'taglib' directive for a JSP page. Given a design goal, create the custom tag structure in a JSP page to support that goal. Given a design goal, use an appropriate JSP Standard Tag Library (JSTL v1.1) tag from the "core" tag library.
  • Building a Custom Tag Library: Describe the semantics of the "Classic" custom tag event model when each event method (doStartTag, doAfterBody, and doEndTag) is executed, and explain what the return value for each event method means; and write a tag handler class. Using the PageContext API, write tag handler code to access the JSP implicit variables and access web application attributes. Given a scenario, write tag handler code to access the parent tag and an arbitrary tag ancestor. Describe the semantics of the "Simple" custom tag event model when the event method (doTag) is executed; write a tag handler class; and explain the constraints on the JSP content within the tag. Describe the semantics of the Tag File model; describe the web application structure for tag files; write a tag file; and explain the constraints on the JSP content in the body of the tag.
  • J2EE Patterns: Given a scenario description with a list of issues, select a pattern that would solve the issues. The list of patterns you must know are: Intercepting Filter, Model-View-Controller, Front Controller, Service Locator, Business Delegate, and Transfer Object. Match design patterns with statements describing potential benefits that accrue from the use of the pattern, for any of the following patterns: Intercepting Filter, Model-View-Controller, Front Controller, Service Locator, Business Delegate, and Transfer Object.
Read More/Download

Popular Posts