Google Search Engine
Tuesday, February 5, 2008
JSF(Faces-config.xml)
The Java Platform, Enterprise Edition specification refers to this type of file as an Application Configuration Resource File.
There may be more than such file within a Java Enterprise application.
Most simple Java based dynamic web applications make their configuration files available as a resource named /WEB-INF/faces-config.xml
If a resource named /META-INF/faces-config.xml exists in any of the JAR files within the web application's /WEB-INF/lib/ directory or in parent class loaders, it is loaded as a configuration resource.
Enterprise-scale applications that delegate partial responsibility for maintaining configuration files to separate groups may specify one or more paths to multiple faces-config.xml configuration files. The relevant context initialization parameter is called javax.faces.application.CONFIG_FILES. Multiple (comma-delimited) paths to Application Configuration Resource Files may be specfied.
The faces-config.xml file effectively provides the glue that links together multiple elements in JSF's interpretation of the Model-view-controller (MVC), Factory Pattern and Inversion of Control (IoC) software design patterns.
By centralising all of these configuration aspects of JSF in a single location, faces-config.xml itself implements the Encapsulation design pattern.
The format of the file is XML version 1.0 compliant. The structure of the file is defined by a Document Type Definition (DTD), which is subject to license terms of Sun Microsystems Inc. This is published at:
http://java.sun.com/dtd/web-facesconfig_1_0.dtd
The top level definition elements within a Version 1.0 Java Server Faces configuration are as follows:
application - JSF's solution for defining classes that have application-wide scope i.e. only a single instance of the object will exist
component - JSF's solution for defining concrete user interface implementation classes that have a unique relationship with a specified type identifier. Component definitions also include related properties (JavaBean configuration elements) and attributes (configuration elements implemented by component).
converter - JSF's solution for defining concrete converter implementation classes that have a unique relationship with a specified converter identifier. Converter definitions also include related properties (JavaBeans properties of the Converter implementation class that may be configured to affect the operation of the Converter) and attributes (configuration elements that may be configured on the corresponding User Interface Component in order to affect the operation of the Converter).
factory - JSF's solution for enabling definition of factory objects, that instaniate other objects, enabling implementation of the Factory Pattern
lifecycle - JSF's solution for enabling the specification of modifications to the default "lifecycle" of a web application.
managed-bean - JSF's solution for instatiating & initialising Java objects, enabling implementation of the Inversion of Control design pattern
navigation-rule - JSF's solution for controlling transitions between JSP views
referenced-bean - JSF's solution for capturing at design time the promise that a Java object of the specified type will exist at runtime in some scope, under the specified key.
render-kit - JSF's solution for defining concrete RenderKit implementation classes that have a unique relationship with a specified render-kit-id. If no render-kit-id is specified, the identifier of the default RenderKit (RenderKitFactory.DEFAULT_RENDER_KIT) is assumed.
validator - JSF's solution for defining concrete Validator implementation classes that have a unique relatinoship with a specified validator identifier.
Validator definitions also include related properties (JavaBeans properties of the Validator implementation class that may be configured to affect the operation of the Validator) and attributes (configuration elements that may be configured on the corresponding User Interface Component in order to affect the operation of the Validator).
JavaServer Faces
A set of APIs for representing user interface (UI) components and managing their state, handling events and input validation, converting values, defining page navigation, and supporting internationalization and accessibility
A default set of UI components
Two JavaServer Pages (JSP) custom tag libraries for expressing a JavaServer Faces interface within a JSP page.
A server-side event model
State management
Managed Beans (JavaBeans created with dependency injection)
Unified Expression Language for both JSP 2.0 and JSF 1.2
Saturday, December 1, 2007
Ajax framework
Apache Struts
open-source web application framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model-view-controller (MVC) architecture.
JavaServer Pages
JavaServer Pages (JSP) is a Java technology that allows software developers to dynamically generate HTML, XML or other types of documents in response to a Web client request. The technology allows Java code and certain pre-defined actions to be embedded into static content.
The JSP syntax adds additional XML-like tags, called JSP actions, to be used to invoke built-in functionality. Additionally, the technology allows for the creation of JSP tag libraries that act as extensions to the standard HTML or XML tags. Tag libraries provide a platform independent way of extending the capabilities of a Web server.
JSPs are compiled into Java Servlets by a JSP compiler. A JSP compiler may generate a servlet in Java code that is then compiled by the Java compiler, or it may generate byte code for the servlet directly. JSPs can also be interpreted on-the-fly reducing the time taken to reload changes.
Java Servlet
The Java Servlet API allows a software developer to add dynamic content to a Web server using the Java platform. The generated content is commonly HTML, but may be other data such as XML. Servlets are the Java counterpart to non-Java dynamic Web content technologies such as PHP, CGI and ASP.NET. Servlets can maintain state across many server transactions by using HTTP cookies, session variables or URL rewriting.
The Servlet API, contained in the Java package hierarchy javax.servlet, defines the expected interactions of a Web container and a servlet. A Web container is essentially the component of a Web server that interacts with the servlets. The Web container is responsible for managing the lifecycle of servlets, mapping a URL to a particular servlet and ensuring that the URL requester has the correct access rights.
A Servlet is an object that receives a request and generates a response based on that request. The basic servlet package defines Java objects to represent servlet requests and responses, as well as objects to reflect the servlet's configuration parameters and execution environment. The package javax.servlet.http defines HTTP-specific subclasses of the generic servlet elements, including session management objects that track multiple requests and responses between the Web server and a client. Servlets may be packaged in a WAR file as a Web application.
Servlets can be generated automatically by JavaServer Pages (JSP), or alternately by template engines such as WebMacro. Often servlets are used in conjunction with JSPs in a pattern called "Model 2", which is a flavor of the model-view-controller pattern.
XML
The Extensible Markup Language (XML) is a general-purpose markup language. It is classified as an extensible language because it allows its users to define their own tags. Its primary purpose is to facilitate the sharing of structured data across different information systems, particularly via the Internet.It is used both to encode documents and serialize data. In the latter context, it is comparable with other text-based serialization languages such as JSON and YAML.
It started as a simplified subset of the Standard Generalized Markup Language (SGML), and is designed to be relatively human-legible. By adding semantic constraints, application languages can be implemented in XML. These include XHTML,[4] RSS, MathML, GraphML, Scalable Vector Graphics, MusicXML, and thousands of others. Moreover, XML is sometimes used as the specification language for such application languages.
XML is recommended by the World Wide Web Consortium. It is a fee-free open standard. The W3C recommendation specifies both the lexical grammar, and the requirements for parsing.