Recent Notes

Displaying keyword search results 1 - 10
Created by Dr. Xi on April 26, 2011 20:12:01    Last update: April 28, 2011 15:28:12
An XML schema is a definition of XML files, in XML. It plays the same role as old-time DTDs. Overall, an XML schema file looks like this: <schema attributeFormDefault = (qualified | u... The attribute meanings: targetNamespace : The name space targeted by the current schema definition. It can be any URI. id and version : For user convenience, the W3C spec defines no semantics for them. xml:lang : Natural language identifier defined by RFC 3306 . attributeFormDefault and elementFormDefault : Set default values for the form attribute for attribute and element declarations. blockDefault and finalDefault : Set default values for the block and final attributes for attribute and element declarations. The W3C defined some built-in datatypes . Examples of primitive datatypes are: string ,...
Created by Fang on August 10, 2010 21:37:36    Last update: October 25, 2010 20:18:47
The tags <fmt:formatNumber> Format a numeric value as number , currency or percentage - controlled by the type attribute (defaults to number if type is missing). Syntax: <fmt:formatNumber value="numericValue" [type="... Attributes: Name Dynamic? Type Description value true String or Number Numeric value to be formatted. type true String Specifies whether the value is to be formatted as number, currency, or percentage. pattern true String Custom formatting pattern, must follow the pattern syntax specified by the class java.text.DecimalFormat . currencyCode true String ISO 4217 currency code. Applied only when formatting currencies (i.e. if type is equal to "currency"); ignored otherwise. currencySymbol true String Currency symbol. Applied only when formatting currencies (i.e. if type is equal to "currency"); ignored otherwise. It is used only when currencyCode is...
Created by Fang on August 24, 2010 18:44:24    Last update: August 24, 2010 18:44:24
The tags XML transform tags apply XSLT to XML documents. The XML document may be specified as the doc attribute or enclosed as the body of the <x:transform> tag. Optional <x:param> tags may be used to specify parameters for the XSLT. <x:transform> Syntax: <x:transform doc="XMLDocument" xslt="XSLTStyle... or, include the XML document in the body: <x:transform xslt="XSLTStylesheet" [docSystem... Attributes: Name Dynamic? Type Description doc true String , Reader , javax.xml.transform.Source , org.w3c.dom.Document , or object exported by <x:parse> , <x:set> . Source XML document to be transformed. (If exported by <x:set> , it must correspond to a well-formed XML document, not a partial document.) xslt true String , Reader or javax.xml.transform.Source Transformation stylesheet as a String , Reader , or Source object. docSystemId true...
Created by Fang on August 23, 2010 22:55:58    Last update: August 24, 2010 15:45:04
The tags XML flow control tags are exactly the same as their Core flow control equivalents, except that the test condition with a boolean EL expression is replaced by the select condition with an XPath expression. In the case of the forEach tag, the items attribute is replaced with the select attribute. In a test condition, the XPath expression is evaluated to a boolean value by the rules of the XPath boolean() function, which converts its argument to a boolean as follows: a number is true if and only if it is neither positive or negative zero nor NaN. a node-set is true if and only if it is non-empty. a string is true if and only if its length is non-zero. an object of...
Created by Fang on August 19, 2010 18:32:28    Last update: August 19, 2010 18:32:28
The tags <x:parse> Parses an XML document. The document to be parsed can be specified by the doc attribute or enclosed as the body of the tag. The parsed document is exposed as the var attribute or the varDom attribute. When exposed as var , the type of the exposed object is implementation dependent; when exposed as varDom , the type of the exposed object is org.w3c.dom.Document . Objects exposed by var and varDom can both be used to set the context of an XPath expression. Syntax: <x:parse doc="XMLDocument" {var="var" [sco... or, put the XML document in the element body: <x:parse {var="var" [scope="page|request|s... Attributes: Name Dynamic? Type Description doc true String , Reader Source XML document to be parsed. systemId true String The...
Created by Fang on July 26, 2010 19:18:28    Last update: August 18, 2010 19:13:02
The tags <c:import> The <c:import> tag imports the contents of a URL and expose that in one of three ways: Import contents from a URL and write it out to the page (url may be relative or absolute): <c:import url="theUrl" /> Import contents from a URL and save it to a scoped variable string named by the var attribute. Use the scope attribute to define the scope of the exported variable. <c:import url="theUrl" var="importTest" scope="ses... Import a URL and expose to a Reader object named by the varReader attribute. The scope attribute does not apply. The varReader scoped variable can only be accessed within the body of <c:import> . <c:import url="theUrl" varReader="theReader"/> <c:url> The <c:url> tag constructs a URL and writes it out to the...
Created by Fang on August 17, 2010 21:08:13    Last update: August 17, 2010 21:08:13
JSTL string manipulation functions String manipulation functions are simple and self-evident. You just need to know that they exist. Test it Make these additions to the expanded test application : Create a new Java class StringManipulation : package jstl.demo.handler; import java.... Create a new JSP ( stringmanipulation.jsp ) under webapp : <%@ taglib uri="http://java.sun.com/jsp/jstl/c... Compile and package the WAR with: mvn package Deploy the WAR to a servlet container of your choice (for example, Tomcat or JBoss). Test the page with this URL (Tomcat/JBoss running on port 8080): http://localhost:8080/jstl-demo/demo/StringManipulation You may adjust the URL if your servlet container runs on a different port or the web app is bound to a different context root.
Created by Fang on August 16, 2010 22:00:05    Last update: August 16, 2010 22:12:25
The tags <sql:update> Executes SQL INSERT , UPDATE , DELETE statements, or SQL DDL statements. Syntax: <sql:update sql="sqlUpdate" [dataSource="d... or, put the SQL within the element body: <sql:update [dataSource="dataSource"] [v... Attributes: Name Dynamic? Type Description sql true String SQL update statement. dataSource true javax.sql.DataSource or String Data source associated with the database to update. A String value represents a relative path to a JNDI resource or the parameters for the JDBC DriverManager class. var false String Name of the exported scoped variable for the result of the database update. The type of the scoped variable is java.lang.Integer . scope false String Scope of var. Defaults to "page". <sql:transaction> Establishes a transaction context for <sql:query> and <sql:update> subtags. Syntax: <sql:transaction [dataSource="dataSource"] ... where...
Created by Fang on August 16, 2010 21:44:41    Last update: August 16, 2010 22:01:46
The tags <sql:query> Queries a database. Syntax: <sql:query sql="sqlQuery" var="varName" [scope... or, put the query within the element body: <sql:query var="varName" [scope="{page|req... Attributes: Name Dynamic? Type Description sql true String SQL query statement. dataSource true javax.sql.DataSource or String Data source associated with the database to query. A String value represents a relative path to a JNDI resource or the JDBC parameters for the DriverManager class. maxRows true int The maximum number of rows to be included in the query result. If not specified, or set to -1, no limit on the maximum number of rows is enforced. startRow true int The returned Result object includes the rows starting at the specified index. The first row of the original query result set is at index...
Created by Fang on August 03, 2010 19:50:51    Last update: August 03, 2010 19:50:51
The tags <fmt:message> Writes out a formatted message for the current locale and resource bundle, or stores the resulting message to a scoped variable (when the var attribute is specified). Syntax: <fmt:message key="messageKey" [bundle="resourc... Or, with parameters in body: <fmt:message key="messageKey" [bundle="resourc... <fmt:bundle> Creates a resource bundle for the contained body. Syntax: <fmt:bundle basename="basename" [prefix="prefi... <fmt:setBundle> Sets a resource bundle in a scoped variable, which may be used later by <fmt:message> . Syntax: <fmt:setBundle basename="basename" [var="varNa... <fmt:param> This is used inside a <fmt:message> tag to specify a replacement parameter. <fmt:param value="theParameterValue"/> or <fmt:param>The Parameter Value</fmt:param> Test it Make these additions to the expanded test application : Create 3 resource bundles and place them under src\main\resources . messages_en.properties : label.login=Login label.username=User Name ... messages_es.properties :...
Previous  1 2 Next