Recent Notes

Displaying keyword search results 81 - 90
Created by voodoo on July 01, 2010 18:54:08    Last update: August 31, 2010 22:40:41
Problem: cannot connect to PostgreSQL server because of above error. Solution: add the host entries to the /usr/local/pgsql/data/pg_hba.conf file: # TYPE DATABASE USER CIDR-ADDRESS ... Reference for CIDR address: http://oav.net/mirrors/cidr.html
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 March 23, 2010 03:50:11    Last update: August 18, 2010 21:59:52
This is a simple web application with a single servlet and a single JSP page. It is intended to be a test bed for JSTL tags. You may want to store all syntax, rules, and exceptions in your head, but in my opinion nothing beats a simple test program that allows you play with it all you want. So here it is (build with Maven ). Prerequisites: Maven: http://maven.apache.org/ . You don't need any prior knowledge of Maven, but you need to install the binary. JBoss: http://jboss.org/jbossas/downloads/ , or Tomcat: http://tomcat.apache.org/ if you don't run the SQL tests. You need to know how to deploy a web application (shh! Don't tell your boss it's just copying a file to the deployment folder). Steps: The directory...
Created by Fang on August 18, 2010 20:07:46    Last update: August 18, 2010 20:11:36
JSTL uses XPath expressions as a concise notation to specify or select parts of an XML document. JSTL provides EL like expressions to access web application data and comes with the core function library of the XPath specification. Accessing Web Application Data XPath Expression Mapping $foo pageContext.findAttribute("foo") $param:foo request.getParameter("foo") $header:foo request.getHeader("foo") $cookie:foo maps to the cookie's value for name foo $initParam:foo application.getInitParameter("foo") $pageScope:foo pageContext.getAttribute("foo", PageContext.PAGE_SCOPE) $requestScope:foo pageContext.getAttribute("foo", PageContext.REQUEST_SCOPE) $sessionScope:foo pageContext.getAttribute("foo", PageContext.SESSION_SCOPE) $applicationScope:foo pageContext.getAttribute("foo", PageContext.APPLICATION_SCOPE) For example, to find the bar element whose x attribute equals the value of the HTTP request parameter named paramName : /foo/bar[@x=$param:paramName] Java Type to XPath Type Mappings XPath Type Java Type java.lang.Boolean boolean java.lang.Number number java.lang.String string Object exported by <x:parse> node-set Please note that JSTL, as of version 1.2,...
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 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  5 6 7 8 9 10 11 12 13 14 Next