PART - A 1. WHAT IS THE USE OF XML NAMESPACE? • XML allows document authors to create custom elements.

• This extensibility can result in naming collisions (i.e. different elements that have the same name) among elements in an XML document. • An XML namespace is a collection of element and attribute names. Each namespace has a unique name that provides a means for document authors to unambiguously refer to elements with the same name (i.e. prevent collisions).

2. WHAT ARE THE USES OF XML? • CML – Chemical Markup Language – for chemical equations • MML - Mathematical Markup Language – for Mathematical equations and derivations. • Used in bio medical line.

3. WHAT IS THE USE OF XML? Extensible Markup Language, derived from SGML (Standard Generalized Markup Language. XML is widely supported open technology (i.e. non-proprietary) for electronic data exchange and storage. XML is actually a language used to create other markup languages to describe data in a structured manner. • XML documents contain only data, not formatting instructions, so applications that process XML documents must decide how to manipulate or display the document’s data.

4. WHAT DO YOU MEAN BY DTD IN XML? • DTD means Document Type Definition.

• DTD file is similar to CSS file, because DTD also contains only styles. • DTD contains various styles which are to be applied in XML document . • Like .CSS file .DTD file also should be linked with XML program. Styles in XML program should be save with .xsl (Xml Style Sheet Language) extension.

5. Define XML. • XML is a meta-markup language that provides a format for describing structured data. This facilitates more structured declarations of content and more meaningful search results across multiple platforms.

6. Define DTD. • A DTD is a set of rules that specifies how to use XML markup. It contains specifications for each element, including what the element\'s attributes are, what values the attributes can take on and what elements can be contained in others.

7. What are the XML rules for distinguishing between the content of a document and the XML markup element? 1.The start of XML markup elements is identified by either the less than symbol (<) or the ampersand (&) character 2.Three other characters, the greater than symbol (>), the apostrophe or single quote (‘) and the double quotation marks (“) are used by XML for markup. 3.To use these special characters as content within your document, you must use the corresponding general XML entity.

8. What are the different XSLT elements?

• Stylesheet • Value-of • For-each • Sort • Text 9. What is VoiceXML? VoiceXML is an emerging standard for speech-enabled applications.Its XML syntax defines elements to control a sequence of interaction dialogs between a user and an implementation platform. VoiceXML uses XML text to drive voice dialogs.

10. What is XQuery? XQuery is a W3C initiative to define a standard set of constructs for querying and searching XML documents. XQuery brings database query processing to XML.

11. What is XForm? XForm is an XML approach that overcomes the limitations of HTML forms. XForm includes a variety of buttons, scrollbars and menus. It generates XML form data as output. XForm\'s model has the capability to work with the variety of user interfaces.

12. What is XPath? Xpath is used to navigate XML tree structures. XPath gets its name from its use of a path notation to navigate through the hierarchical tree structure of an XML document. It is an important XML technology due to its role in providing a common syntax and semantics for functionality in both XSLT and XPointer. 13. what are complex types? complex types are an important aspects of xml schema that allow application developers to define application-specific datatypes that can be checked by programs that check XML

Xforms . What all are the presentation technologies? CSS . 16. what are the Importants of SAX? SAX is an event driven. Mozquito Xforms preview .it is a GUI toolkit for creating user interfaces & delivering the results in is an XML. 15.receive & process XML document.provides users with ability to describe how xml data & document are to be implements a large part of X-forms & uses X-form together with XSL-FO on user interface side.highlighting that element or taking the user directly to that point in the an XML based Web developement s/w that implements Xforms & gives current Web browser the ability to send. 14.xpath gets its name from its use of a payh notation to navigate through the hierarchical tree structure of an XML document XQUERY . .cascading syle sheets XSL . XPATH .document for validity. Xhtml . VoiceXML .based languages used to transform XML documents into others format such as HTML for web is a java based XML is an emerging standard for speech enabled application.Explain any two XForm implementations? X-Smiles .it is w3c initiative to define a standard set of constructs for querying & searching XML document. what are all the Transformation techniques? XSLT . .it is used yo replace HTML with more flexable approach to display webcontent. XLINK . XML schema divides complex types into two categories: those with simple content & those with complex content. 17.

Complex data types cannot be defined.xml” 20. 18. 2. What is DTD? How is it different from XML? DTD stands for Document Type Definition DTD is a description of the structure & the elements and attributes that define a class of XML document. Data type for elements limited to text. Numerous predefined data types available. DTD Xml Schema Dtd is used to define the structure of an xml document. 3. Ability to define complex type that map to application data structure. XML HTML . Xml schema is used to define the structure of an xml document. It allows computers to store and exchange data in a format that can be interpreted by any other computer with different hardware or software specification. DTD can be declared both internally in a XML document and as an external reference.SAX supports processing pipelines. SAX requires programmers to maintain state. What is XML? How it is different from HTML? Xml is the text based make up language that stores the data in a structured format using meaningful tags. What is metadata? Literally data about data. XML element and attribute names are considered metadata in that they may be used to describe the data contained in a document.dtd” 4. 19. Metadata isn’t needed but it certainly helps. Dtd document is stored as “filename.Xml schema document is stored as “filename.

Several languages are derived from xml & wml HTML can be derived from xml. • Directives are JSP elements that provide global information about an entire JSP page.. Xml uses indefinite. user defined. 21. • language • extends • import • session • buffer • contenttype .xml stands for Extensible markup language HTML stands for Hyper Text Mark Up Language. Define Directives. • The page directive defines information that will be globally available for that Java Server Page.2. Write down the various attributes for the page directives in JSP. meaningful set of tags which can be used to include XML data in the webpage. HTML uses a fixed set of tags which can be used to specify the appearance of the webpage. 22.

You can use any characters in the body of the comment except the closing --%> combination. and does not process any code within hidden comment tags. What is a Expression? An expression tag contains a scripting language expression that is evaluated.This comment will not be visible to the colent in the page source --%> </body> </html> 25. JSPSyntax <%-. either in the displayed JSP page or the HTML page source.23.util. Like <%= someexpression %> <%= (new java. A hidden comment is not sent to the client.Date()). The JSP engine ignores a hidden comment. Because the value of an expression is converted to a String. you can escape it by typing --%\\>.toLocaleString() %> You cannot use a semicolon to end an expression . If you need to use --%> in your comment. you can use an expression within text in a JSP file. What is a Hidden Comment? A comments that documents the JSP page but is not sent to the client.comment --%> Examples <%@ page language=\"java\" %> <html> <head><title>A Hidden Comment </title></head> <body> <%-. converted to a String. The hidden comment is useful when you want to hide or \"comment out\" part of your JSP page. and inserted where the expression appears in the JSP file. 24.

Scriptlets are executed at request time. <%! somedeclarations %> <%! int i = 0.Declare variables or methods to use later in the file (see also Declaration). as long as they are separated by semicolons. %> <%! int a. when the JSP engine processes the client request. variable or method declarations. You must write plain text. A declaration must contain at least one complete declarative statement. What is a Scriptlet? A scriptlet can contain any number of language statements. HTML-encoded text. What are implicit objects? List them? . or other JSP tags outside the scriptlet. b. 2. What is a Declaration? A declaration declares one or more variables or methods for use later in the JSP source file. c. You can declare any number of variables or methods within one declaration tag. If the scriptlet produces output.Within scriptlet tags. %> 27. from which you can display it. The declaration must be valid in the scripting language used in the JSP file. 28.26. the output is stored in the out object. you can 1.Write expressions valid in the page scripting language (see also Expression). 3.Use any of the JSP implicit objects or any object declared with a <jsp:useBean> tag. or expressions that are valid in the page scripting language.

What are the different scope valiues for the <jsp:useBean>? The different scope values for <jsp:useBean> are page request . without the client being informed that a different resource is going to process the request. the request is sent to another resource on the server. This process occurs completly with in the web container. 30. it causes the web container to return to the browser indicating that a new URL should be requested.Certain objects that are available for the use in JSP documents without being declared first. Difference between forward and sendRedirect? When you invoke a forward request. When a sendRedirtect method is invoked. The implicit objects re listed below request response pageContext session application out config page exception 29. This extra round trip a redirect is slower than forward. These objects are parsed by the JSP engine and inserted into the generated servlet. Because the browser issues a completly new request any object that are stored as request attributes before the redirect occurs will be lost.

The _jspservice().The container calls the _jspservice() for each request. Explain the life-cycle mehtods in JSP? THe generated servlet class for a JSP page implements the HttpJspPage interface of the javax. JSP Syntax <!-. However the JSP specification has provided the HttpJspPage interfaec specifically for the JSp pages serving HTTP requests. 32.servlet package. This interface declares one method _jspService().The container calls this when it decides take the instance out of service. passing it the request and the response objects.It is called before any other method.jsp package. returning the comment in the HTML output sent to the client. The JspPage interface declares only two mehtods .session application 31. the generated servlet class thus implements all the methods of the these three interfaces.servlet.This is a commnet sent to client on . It is the last method called n the servlet instance. What is a output comment? A comment that is sent to the client in the viewable page source.comment [ <%= expression %> ] --> Example 1 <!-.jspInit() and jspDestroy() that must be implemented by all JSP pages regardless of the client-server protocol.The JSP engine handles an output comment as uninterpreted HTML text.The container calls the jspInit() to initialize te servlet instance. The jspDestroy(). The jspInit(). and is called only once for a servlet instance. Hte HttpJspPage interface extends the JspPage interface which inturn extends the Servlet interface of the javax. You can see the comment by viewing the page source from your Web browser.

toLocaleString() %>--> Displays in the page source: <!-.This is a commnet sent to client on January 24. When you start the application the server will load the global.asa file into memory. 2004 --> 33.<%= (new java. What is global.Application -It manages your web application. Define response object and list its methods.asa file is a Active Server Application file you can track and manage the application and session events.Date()). The response object transmits information from the web server to browser. Define ASP.Server -It controls behavior of your web server 4.Request -It retrieves information from the browser for processing at the server.Session -It manages and tracks individual user sessions.asa file? The global. 35.util. What are the ASP objects? 1. 3. Active Server Pages (ASP) is a server-side scripting technology that can be used to create dynamic and interactive web applications. 34. variables and objects. 36.Response -It transmits information from the web server to web browser 5. 2. .

extends 3. Directives are JSP elements that provide global information about an entire JSP page.Methods are: 1.Write 2. Write down the various attributes for the page directives in JSP. The page directive defines information that will be globally available for that Java Server Page.Clear 7.Flush 37.AppendToLog 5.Redirect 4.AddHeader 6. Define Directives. 1. language 2. 38. Define JSP. Java Server Pages (JSP) are simple technology used to generate dynamic HTML on the server side.BinaryWrite 3. import . 39.

Define XML. or as an external reference.Define DTD. buffer 6. • A SOAP message’s body contains either a request or a response. session 5. . You must define your own tags XML is designed to be self-descriptive XML is a W3C Recommendation 41. XML stands for EXtensible Markup Language XML is a markup language much like HTML XML was designed to carry data. . contenttype 40. What is SOAP? (Simple Object Access Protocol) • SOAP is an XML based protocol that allows applications to easily over the internet using XML documents called AOAP message. not to display data XML tags are not predefined. which is a structure that describes a method call.4. • A SOAP message contains an envelope. A DTD can be declared inline inside an XML document. 1. It defines the document structure with a list of legal elements and attributes. A Document Type Definition (DTD) defines the legal building blocks of an XML document.

4. 5. SOAP. Web Services Description Language (WSDL) and Universal Description. which is a request for another machine to perform task. text-based standards that enable components written in different languages and on different platforms to communicate. • They are ready to use pieces of software on the Internet. XML.g. A SOAP response message is an HTTP response document that contains the results from the methods call (e. WHAT IS THE USE OF WEB SERVICES? • Web services encompass a set of related standards that can enable two computer • The data is passed back and forth using standard protocols such as HTTP. Visual C++. error messages. SQL and the ODBC driver pack contains drivers for the Access. return values. dBase.) 2. Discovery and Integration (UDDI) are the standards on which web services rely. • The RPC specifies the method to be invoked and any parameters the method takes. Excel and Retrieve databases. Define ODBC. Paradox. 3. What are the advantages of web services? . • The application sends the SOAP message via an HTTP POST. the same protocol used to transfer ordinary web pages. There are interfaces for Visual Basic. • UDDI is another XML based format that enables developers and business to publish and locate Web services on a network. What do you mean by JDBC? • JDBC Part of the Java Development Kit which defines an application-programming interface for Java for standard SQL access to databases from Java programs. • It is a standard for accessing different database systems.• A request message’s body contains a Remote Procedure Call (RPC). Text. • Web services operate using open.

WSDL 7. XML significantly reduces the burden of deploying the many technologies needed to ensure the success of Web services. flexible and inherently extensible data format. It provides a standard. Connect existing software. SOAP. composable framework for packaging and exchanging XML messages. It offer a standard. extensible. . 6. weather reports. There are things applications need very often. 8. In the context of this architecture. What is SOAP? Service Oriented Architecture Protocol. With Web services you can exchange data between different applications and different platforms. Web services can help to solve the interoperability problem by giving different applications a way to link their data. What is XML ? Extensible markup language.Reusable application-components. or even language translation as services. So why make these over and over again? Web services can offer application-components like: currency conversion. List out some web service technologies? XML. SOAP also provides a convenient mechanism for referencing capabilities (typically by use of headers).

9. 10. XML provides a language which can be used between different platforms and programming languages and still express complex messages and functions. WHAT ARE THE VARIOUS Web services platform elements? • SOAP (Simple Object Access Protocol) • UDDI (Universal Description.How Does web services Work? The basic Web services platform is XML + HTTP. 12. The messages themselves are described abstractly and then bound to a concrete network protocol and message format. What are Web Services? Web services are application components Web services communicate using open protocols Web services are self-contained and self-describing Web services can be discovered using UDDI Web services can be used by other applications XML is the basis for Web services 11. The HTTP protocol is the most used Internet protocol. WSDL describes Web services starting with the messages that are exchanged between the requester and provider agents. What is WSDL? Web Services Description Language WSDL is a language for describing Web services. Discovery and Integration) • WSDL (Web Services Description Language) .

DEFINE WSDL. [SOAP 1. WHAT ARE THE TYPES OF Web SERVICES AND ITS USES? Reusable application-components. FTP. or a proprietary messaging protocol. SOAP 1. Web services can help to solve the interoperability problem by giving different applications a way to link their data. There are things applications need very often. So why make these over and over again? Web services can offer application-components like: currency conversion. or even language translation as services. weather reports. SMTP.2 Part 1] defines an XML-based messaging framework: a processing model and an exensibility model. In the context of this architecture. such as HTTP. WRITE SHORT NOTES ON SOAP. 14. With Web services you can exchange data between different applications and different platforms. WSDL 2. composable framework for packaging and exchanging XML messages. SOAP 1. 16. 15. Connect existing software.0[WSDL 2. just as there are many ways to build and use Web services.0 Part 1] is a language for describing Web services. extensible. SOAP messages can be carried by a variety of network protocols. There are many ways to visualize these technologies.13.2 also provides a convenient mechanism for referencing capabilities (typically by use of headers).2 provides a standard. WRITE SHORT NOTES ON Web Services Technologies? Web service architecture involves many layered and interrelated technologies. RMI/IIOP. .

Nevertheless. and Integration (new window). 18. EXPLAIN DTD for XML Schemas ♣ XML documents are processed by applications ♣ Applications have assumptions about XML documents ♣ DTDs allow to formalize some of these constraints ♣ Part of the constraint checking must still be programmed 20. 17. More on Universal Description. even without the discovery portion. Discovery. The UDDI registry is intended to eventually serve as a means of \"discovering\" Web Services described using WSDL . WHAT ARE Modeling DTDs. An alternative to UDDI is the ebXML Registry (new window).? ♣ Data models can be mapped to many different DTDs ♣ What is a good DTD? What is a bad DTD? . the UDDI registry is a way to keep up-to-date on the Web Services your organization currently uses. The messages themselves are described abstractly and then bound to a concrete network protocol and message format. How much \"discovery\" will be used in the early days of Web Services is open to discussion. The idea is that the UDDI registry can be searched in various ways to obtain contact information and the Web Services available for various organizations. Discovery. and Integration (UDDI) The directory shown in the above figure could be a UDDI registry. WRITE SHORT NOTES ON UDDI Universal Description. 19. Draw the architecture of UDDI.WSDL describes Web services st arting with the messages that are exchanged between the requester and provider agents.

23.[1] Version 1. however SOAP is different from SOA. The acronym is sometimes confused with SOA. ♣ In our SOAP tutorial. 22. What is SOAP? • SOAP stands for Simple Object Access Protocol • SOAP is a communication protocol • SOAP is for communication between applications • SOAP is a format for sending messages • SOAP communicates via Internet • SOAP is platform independent • SOAP is language independent • SOAP is based on XML • SOAP is simple and extensible • SOAP allows you to get around firewalls . which stands for Service-oriented architecture. and how it uses XML to exchange information between applications. 2003.2 became a W3C recommendation on June 24. DEFINE SOAP structure SOAP once stood for \'Simple Object Access Protocol\' but this acronym was dropped with Version 1.♣ How does the DTD affect further processing 21. WHAT ARE THE SOAP Related Technologies? ♣ SOAP is a simple XML-based protocol to let applications exchange information over HTTP.2 of the standard. you will learn what SOAP is.

These objects are available at the widest context level.servlet.lang.lang.JspWriter page java. This object allows the exception data to be accessed only by designated JSP "error pages. The method getInitParameter() is used to access the initialization parameters. Page object represents the current page that is used to call the methods defined by the translated servlet class. But we can pass them to our own method if we wish to use them locally in those functions. that allows to share the same information between the JSP page's servlet and any Web components with in the same application.ServletConfig exception java. There are nine implicit objects. the developer do not need to create them explicitly.ServletResponse session javax.JSP Implicit Objects Implicit objects in jsp are the objects that are created by the container automatically and the container makes them available to the developers.servlet.servlet. They are available only within the jspService method and not in any declaration.servlet. The implicit objects are parsed by the container and inserted into the generated servlet code. Implicit objects are used for different purposes.xml) inside the element <jsp-file>.ServletConfig class.http. hence.lang. • Config: These object has a page scope and is an instance of javax. It provides the output stream that enable access to the servlet's output stream.servlet.JspWriter class.jsp.servlet.Object PageContext javax.ServletContext config javax. Parameters of this objects can be set in the deployment descriptor (web.Throwable class. • Exception: This object has a page scope and is an instance of java. Config object allows to pass the initialization data to a JSP page's servlet.servlet. they are called implicit objects. Since these objects are created automatically by the container and are accessed using standard variables.Throwable out javax. Our own methods (user defined methods) can't access them as they are local to the service method and are created at the conversion time of a jsp into a servlet.jsp.PageContext request javax. First type cast the servlet before accessing any method of the servlet through the page.HttpSession • Application: These objects has an application scope." • Out: This object allows us to access the servlet's output stream and has a page scope.jsp. . • Page: This object has a page scope and is an instance of the JSP page's servlet class that processes the current request. Here is the list of all the implicit objects: Object Class application javax. Out object is an instance of javax.servlet.servlet.ServletRequest response javax.

write("This is use for print output stream on client").servlet.jsp. JSP container does all work like instantiating. Request: Request object has a request scope that is used to access the HTTP request data. Perhaps it is the most commonly used object to manage the state contexts. The container passes this object to the _jspService() method.lang. pageContext is to managed various scope of attribute in .• • • • Pagecontext: PageContext has a page scope. pageContext pageContext instance that contains all data’s information. Request object implements javax.getWriter() to send output to client <% %> out. Out is Output Stream use response. This API is extensively used if we are implementing JSP custom tag handlers. PageContext also provides access to several page attributes like including some static or dynamic resource.Object class.servlet.PageContext class. Pagecontext is the context for the JSP page itself that provides a single API to manage the various scoped attributes.ServletResponse class. Object page = this. 2.servlet. Container generates to this object and passes to the _jspService() method as a parameter. page <% %> page is used by java. Response object is an instance of the classes that implements the javax. JSP provide following implicit objects 1. Implicit objects are provided by JSP itself. Response: This object has a page scope that allows direct access to the HTTPServletResponse class object. out out is javax. and also provides a context to associate the request-specific data.JspWriter class use for printing. defining and maintenance.http.servlet. This object persist information across multiple user connection. It uses the getParameter() method to access the request parameter. This helps to access attribute and other field’s object set in JSP page. which is associated with JSP page.HttpSession class. we don’t need to define it we can simply use these objects by setting values and attributes. Session: Session object has a session scope that is an instance of javax.ServletRequest interface. 3.jsp. Page is instance of JSP page’s Servlet. pageContext is in javax.servlet.

servlet.session. response The HttpServletResponse object that javax. application scope This method is used to redirect or forward the current ServletRequest or ServletResponse to another active component Returns the object associated with name in the page scope Get the scope where a given attribute is defined Provide access to error information Get current value of the exception Object Get current value of out object ServletRequest Get current value of request object ServletResponse Get current value of response object ServletConfig Get any initialization parameters and startup configuration for this servlet ServletContext Gets the context from the servlet's ServletConfig object HttpSession Return the current value of session object 4.getException() pageContext. The HTTP response is send to client through response object More example response object reference . The HTTP request is send to server through request object.getAttribute(String Name) pageContext.http.getResponse() pageContext.getAttributesScope(String Name) pageContext. Method of pageContext are following: Method Return pageContext.getOut() pageContext.getSession() void Object int ErrorData Exception JspWriter Description Search for named attribute in JSP page Request.getServletConfig() pageContext. request The HttpServletRequest object that javax.getServletContext() pageContext.forward(String relativeURLPath) pageContext.servlet.getErrorData() pageContext.HttpServletRequest interface is provided to access request objects in JSP.findAttribute(String Name) Object pageContext.getRequest() pageContext.http. More example request object reference 5.shared information object.HttpServletResponse interface is provided to send response object in JSP.

xml file with <init-param> and method is used to get getServletConfig() <servlet> <servlet-name>ServletName</servlet-name> <servlet-class>com. More example of application object reference 9.ServletName</servlet-class> <init-param> <param-name>dbUserName</param-name> <param-value>root</param-value> </init-param> </servlet> Method use to get init param is getInitParameter() to get value inside <param-value> and getInitParameterNames() to get name of <param-name> 8.servlet.ServletContext.servlet.jsp" %> <%@ page isErrorPage="true" %> Example of Exception Implicit object in JSP exception. <%@ page errorPage="error. session Session object is used to track information about a user. session is interface and maintain by HttpSession javax. If exception is not caught it should throw on error page.jsp <%@ page language="java" errorPage="error.HttpSession.6. Servlet configuration object is used to pass information of servlet to Servlet container during initialization of servlet. This is defined in web. Application is in javax.ServletConfig interface. More example of session object reference 7. It is in javax. Exception when throw on error page it should be isErrorPage= true at in directive page.jsp" %> <html> <head> <title>Implicit Exception object</title> </head> <body> .servlet. config config object is related to get servlet’s configuration information.myapp.http.servlet. application Application object is used to share information for all JSPs and Servlets in the application context. exception Exceptions are condition that can be caught and recovered from it.

io.<% String a=null.getMessage()%></strong><br> </body> </html> XML METHODS %> Methods • • • • • • • • • • • • • • • • abort [ie] createAttribute createCDATASection (data ) createComment (comment) createDocumentFragment (data ) createElement (tagName) createEntityReference (name ) createNode [ie] (type. %> </body> </html> error. nameSpaceURI) createProcessingInstruction (target.toString() %></strong><br> Message : <strong><%=exception. data) createTextNode (data) getElementsByTagName (tagName) load [ie] (url) loadXML [ie] (xml_string) nodeFromID [ie] (id_string) save [ie] (objTarget) XML Parser . name.*" isErrorPage="true" <html> <head> <title>Implicit Exception Error page</title> </head> <body> The Exception is <strong><%= exception.parseInt(a).jsp <%@ page language="java" import="java. int b=Integer.

and also used extensively within the XML Converters. Ruby and so on. every program must implement or call on an XML parser.) The author of Saxon. This allows the calling program to ignore the bits it doesn't care about. DOM can be very memory intensive. by the time you figure in the overhead for . Parsers are used everywhere in software. Michael Kay. What is SAX? SAX stands for Simple API for XML. The design inspiration and subsequent coodination was done by Dave Megginson. C++. It differs from SAX in that it builds the entire XML document representation in memory and then hands the calling program the whole chunk of memory. SAX is often used in certain highperformance applications or areas where the size of the XML might exceed the memory available to the running program. DOM and pull. For each type. There are different types. The disadvantage is that the calling program must keep track of everything it might ever need. including Crimson and its successor. and each has its advantages. including Java. PHP. What's a DOM? DOM stands for Document Object Model. it creates an event that the calling program can use. C#. himself wrote Ælfred — another SAX parser. Perl. and just keep or use what it likes. SAX is used everywhere in Stylus Studio®. Unless a program simply and blindly copies the whole XML file as a unit. VB# (in fact. There have been many implementations of SAX parsers. Its main characteristic is that as it reads each unit of XML. Dr. An XML Parser is a parser that is designed to read XML and create a way for programs to use XML. who continues to maintain the SAX Project website. It is used for building certain representations of XML structure for the XSLT and XQuery Mappers. there are some excellent implementations freely available for a variety of languages. Python. The Apache project has sponsored some.Net language).0.A parser is a piece of program that takes a physical representation of some data and converts it into an in-memory form for the program as a whole to use. any . The main types of parsers are known by some funny names: SAX. The SAX standard currently is at version 2. Xerces (available in both C++ and Java.

the pull parser can choose to skip events (or in some implementations. since it pushes events out to the calling application. even if it violates some of the conventions of that language. or the data is being assembled just in time for the next stage to use it. it has tried to maintain the same programming interface for whatever language it is implemented in. JDOM. DOM (currently up to level 3. while in Microsoft's .managing the relationships of the nodes. and unlike SAX which returns every event. and Microsoft's MSXML and System.Net platform. it knows for each component what the optimal representation is. which are areas where either the data is too large to fit in memory. They ask for the next available event. This has led to some DOM-like implementations that are more in keeping in line with the philosophy of the local language. There are places in Stylus Studio® where a DOM is necessary. sit and wait for the application to come calling. The XML Pipeline deployer is very smart. Examples in Java include TinyTree (used only in Saxon).Xml XmlReader is built right in. whole sections of the document) that it is not interested in. the current leading contender for streaming parsers appears to be StAX.0) has been widely criticized for being too complicated. In Java.Xml classes. on the other hand. The converters are designed to work with both the SAX and the pull parser interfaces. Both the underlying Saxon engine and DataDirect XQuery support pull parsing. It is designed to be used with large data sources. Both Saxon and DataDirect XQuery support pull parsing. and will work hard to ensure that memory is conserved wherever possible by avoiding unnecessary transformations from DOM to SAX and back. with two notable exceptions. DOM4J and XOM. What's a Pull Parser? SAX is a push parser. and the application basically loops until it runs out of XML. which will be covered below. The Tree View in the XML Editor and all XSLT and XQuery processors. Implementations include Xerces (again both in C++ and Java). the System. StAX — Streaming API for XML The StAX pull-parser has been implemented in the Java world by a standard called JSR-173. no matter what the brand. Pull parsers are useful in streaming applications. Pull parsers. particularly in . In some instances. you might be talking 4× to 8× the size of the original document in memory usage.

whether you like Crimson or Ælfred or Xerces. Standards and Stylus Studio® One very important point is that each of these is an industry-recognized standard. pull parsing can give a significant performance boost. and we are proud of this heritage Download and Examine a copy of Stylus Studio® today. and see how powerful a fully standards-compliant XML application you can design and deploy. JSP Page Directive JSP • • • • • • • • • • • • • • JSP Introduction JSP Environment Setup JSP Tags JSP Directives JSP Page Directive JSP Directive Tag and Scriptlet tag JSP Action tags JSP Request Object JSP Implicit and Session Objects JSP Response Object JSP Architecture Working with JSP Sessions JSP Out Object JSP Application Object Home Tutorials JSP JSP Page Directive Author : Exforsys Inc. As a division of DataDirect Technologies. Whether you like the SJSXP or Woodstox StAX parsers. DOM and StAX for any given application is a matter for testing. you are never locked in by Stylus Studio®. but both implementations have been so highly tuned that the choice between SAX. Since within Stylus Studio® XML Enterprise Suite the XML Pipeline constructor knows the capabilities of each node in the pipeline. this choice is handled automatically for you.DataDirect's implementation. or you want to migrate from one platform to another for deployment. the point is you have a choice. Published on: 28th Apr 2007 . This means that whatever you do is portable across implementations. If one fails to perform for you in the way you hope. we have a legacy of participation and conformance to the standards process.

isThreadSafe attribute is used to set and ensure whether thread safety is implemented in the JSP page. then an exception is thrown when the output buffer gets full and results in overflow. depending on the set value of true or false. Ads autoFlush: autoFlush attribute is used to specify whether or not to automatically flush out the output buffer when it is full. page and autoFlush are keywords. the buffer will be flushed automatically when it is full.JSP Page Directive In this JSP tutorial.%@ page isThreadSafe="true|false" %&gt. you will learn about JSP page directive. its value is true . . This means. isThreadSafe: isThreadSafe attribute is used to set whether the generated Servlet handles multiple requests or single requests. In the above example. Syntax of autoFlush attribute available for page directive is written as: &lt. examples and explanations. NOTE: The user should not to set the autoflush to false when the buffer attribute is set to none. When the autoflush attribute is set to false. Syntax of isThreadSafe attribute available for page directive is: &lt. attributes of the page directive along with syntax.%@ page autoFlush = "true|false" %&gt. True or false value can be set to autoFlush attribute. by default.

Syntax of info attribute available for page directive is: &lt. info: Programmers make use of info attribute to place the information or documentation for a page. If the value of this attribute is set to false. exforsys. In the above statement.%@ page info = "text" %&gt.2006" %&gt. 2006. The above text. page and info are keywords. This is actually text string that is written as input text in the compiled JSP page. is a text string written as text in the compiled JSP page. copyright and date are placed in this attribute. version.In the above statement.%@ page info = "exforsys. This is actually text string written as input text in the compiled JSP page. A true or false value can be set and. The details of documentation or information are placed inside " ". It implies that the JSP container can handle or send multiple concurrent client requests to the JSP page by starting a new thread. Details such as: author. For example: &lt. page and isThreadSafe are keywords. the value is set to example. by example. . then the JSP container sends client requests only one at a time to the JSP page.

errorPage: If the programmer wants to place errors in a different page then the URL to the error page can be mentioned in this attribute as errorPage. the value is set to false. the user specifies the attribute errorpage is: &lt. Syntax of errorPage attribute available for page directive is as below: &lt. page and errorPage are keywords. . In the above statement. By default. page and isErrorPage are keywords. Syntax of isErrorPage attribute available for page directive is: &lt. If the value is set to true. For example.%@ page errorPage = "/handleerr/testerr.jsp" %&gt. meaning that the user cannot make use of the exception object in the JSP page. the value is false.%@ page errorPage = "relativeURL" %&gt. By default. then it means that the user can make use of the exception object in the JSP page.%@ page isErrorPage="true|false" %&gt. isErrorPage: isErrorPage attribute is used to specify whether or not a JSP page displays an error page by setting the value as true or false. In the above statement.

3. page encoding. pageEncoding and contentType attributes must appear at the beginning of the page. However there are few exceptions. anywhere and all attributes will be applied together to the whole translation unit.age directive is used to specify a number of page specific attributes such as content type. otherwise a translation error will occur. classes to import and buffering model etc. . An attribute must appear only once in a translation unit unless the values of the attribute are same for all occurrences. Note: A JSP source file and any other files included with include directive is called the translation unit. 2. pageEncoding attribute can appear at most once per a file otherwise a translation error will occur. Below is a complete list of attributes that can be used with page directive. The import and pageEncoding can appear more than once in a translation unit. 1. A translation unit can contain more than one instance of page directive. in any order.

servlet. It is similar to java import statement Indicates that the page participates in session. which is the most common mechanism for JSP containers to implement isThreadSafe. If the value specifi is none Than there is no buffering and all out put is written immediately through PrintWriter. Info isErrorPage Indicates weather or not the page is intended to be an error page of some other JSP page. If the value is false than implicit variable session unavailable and any attempt to use it within the body of the page will result in translation error. If a buffer size is specified then output is buffered with a buffer size not less than that specified. If the value is false than implicit object ex caption is unavailable and any attempt to use it within the body of the JSP page will result in translation time error. any arbitrary string can be specified that can subsequently be obtained from the page’s implementation of Servlet. The size of the buffer can be specified in kilobytes.4 specification deprecates SingleThreadModel. Used to provide the information about the JSP page. The path of a servlet can also be specified as the value of errorPage attribute. Default value for MIMETYPE of the generated response is text/html for jsp page in standard syntax and text/xml for JSP documents in XML Page authors are advised against using isThreadSafe. session buffer Specifies the buffering model for the initial JspWriter to handle the response generated by the page. otherwise it will resu in translation error.servlet. Defines whether EL expressions are ignored or evaluated for .Attribute name language extends import Description Specifies the scripting language used in scriptlets.servlet. The default value is not less than 8kb autoFlush Indicates weather the buffered output should be flushed automatically when the buffer is full. isThreadSafe Indicates the threading model to be used by JSP and generated servlet class. kb suffix is required otherwise translation error will occur. True means the JSP is thread safe and container can send multiple simultaneous requests to the page. Value of false means the JSP page is not thread safe and container must send a request at a time. In that case the original Throwable can b obtained by getAttribute() method of the request with any name specified above. If value is true than an implic scripting language variable exception is available that references the exception. or weather an exception should be raised indicating buffer overflow.getServletInfo method.HttpSession is available and references current session. an implicit variable named session of type javax. pageEncoding If pageEncoding attribute is not defined and CHARSET is defined in contentType attribute than it will be used as character encoding of the page. This ca have either of the form”MIMETYPE” or “MIMETYPE. See http://www. that defines the super class of the JSP page’s implementation servlet The comma separated list of class names that will be imported in resulting servlet.html for more information on MIME types. When an uncaught exception occurs. charset=CHARSET”. autoFlush can not be set to true when buffer is none. in other words container must seriali the requests to JSP page Note: The Servlet 2. contentType Defines the MIME type for the response of the JSP page and character encoding for the JSP page and response. Defines the character encoding for the JSP page. expressions and declarations in the JSP page The fully qualified name of a java class.exception. errorPage Defines the URL to another resource withing the currenct web application which is invoked if any checked or uncheck exception is thrown but not caught by the JSP page’s implementation class. JSP page’s implementation servlet class catches the instance of Throwable and passes it to error page by setting it in ServletRequest using setAttribute() method. as the generated Servlet may contain deprecated code.jsp. with the name of javax.jspException and javax.error. If the URL points to another JSP page than when that JSP page is invoked an implicit object exception is available which references the originating uncaught Throwable. If the value is true.

getResponseHeader(header) This returns the value of the specified header. <%@page contentType="text/html. <%@page import=”java.0" encoding="UTF-8"?> <web-app xmlns="http://java. url) . There are only 6 methods that the XmlHttpRequest can call.list.List”/"> </jsp:directive.util. <%@page isThreadSafe=”false”/> In JSP documents in XML format.xsd" version="</tagliburi> <taglib-location>/WEB-INF/taglibs-dbtags.5"> <jsp-config> <taglib> <taglib-uri>http://jakarta. java. abort() This cancels the current request as> Set the response encoding to UTF-8.An example of JSP page directive Following page directive imports List and ArryList classes so it can be used within http://java. charset=UTF-8"/> <?xml version=" language="”java”.com/xml/ns/javaee/web-app_2_5.sun.tld</taglib-location> </taglib> </jsp-config> </web-app> XMLHTTPOBJECT METHODS There are actually not that many methods available on the XmlHttpRequest object.w3." import="”java. getAllResponseHeaders() Returns all the response headers as a key / value pair. page directive can be written as <jsp:directive.sun.apache. open(" xmlns:xsi="http://www.ArrayList”/> Following page directive specifies that the page is not thread safe so container serializes the requests to JSP page and will not send multiple simultaneous" xsi:schemaLocation="http://java.

the XmlHttpRequest object also provides XmlHttpRequest Properties In addition to the 6 methods available via the XmlHttpRequest object. If you are passing parameters with via GET. Additionally. setRequestHeader(header. you will have to do some work on the server side to make it happen correctly. but is quite powerful. Those are the 6 methods available to you via the XmlHttpRequest object.This prepares the XmlHttpRequest object for a call to the server. responseText This returns the response from the server as a string. send(body) This method actually sends the request to the server. readyState This property defines the state of the XmlHttpRequest. you can append them to the URL here. It does require some knowledge of the XML DOM to use. you also have access to 6 properties. This is the way to go if you need to return multiple values from your AJAX request. you will check to see if the readyState is 0 or 4. responseXML This returns the response from the server as an XML document. Url can be relative or absolute. value) The final method allows you to set the specified header with the given value. status This returns the HTTP status code from the server such as 200 for OK or 404 for not found. If you need to make cross domain calls. The body parameter can be used to pass any POST parameters that you would like. onreadystatechange This property sets the method to be called on every state change. but it should be known that you can't make cross domain calls for security reasons. statusText . you will check to see if the readyState is 4. You can format your POST parameters just like a GET querystring. This is usually your event handler for the asynchronous callback. You will most often use this function for setting the content type of the request. Possible values include: 0 1 2 3 4 Uninitated Loading Loaded Interactive Complete When sending the XmlHttpRequest. and in your asynchronous callback handler. If you are only returning one value this is the way to go because it is much easier that trying to walk the XML DOM. Method can either be POST. or PUT. GET.

.This returns a string representation of the HTTP status code such as OK for 200 and Not Found for 404 And that's is for the properties available to you via the XmlHttpRequest object.

Sign up to vote on this title
UsefulNot useful