Recent Notes

Displaying keyword search results 1 - 10
Created by Dr. Xi on September 23, 2013 09:00:22    Last update: September 23, 2013 09:17:55
Tsung is an open-source multi-protocol distributed load testing tool. It's written in Erlang , but don't let that dissuade you. Here are some simple steps to get started. Install Tsung. On Ubuntu, this is simply: sudo apt-get install tsung . Create a config file ( tsung.xml ): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYP... Beware of the dumptraffic attribute. You might want to set it to false for a real load test. Run the test: $ tsung -f tsung.xml start Starting Tsung "L... Generate the reports: $ cd /home/drxi/.tsung/log/20130923-1031 $ /usr... Open the report file in your browser: file:///home/drxi/.tsung/log/20130923-1031/report.html . For HTTPS testing change the server line to: <servers> <server host="192.168.80.160" port="...
Created by Fang on February 10, 2012 16:17:13    Last update: February 10, 2012 16:17:13
The annotation @org.hibernate.annotations.Type overrides the default hibernate mapping type used for a column. This can usually be omitted since Hibernate normaly infers the correct type to use. But @Type is required in ambiguous scenarios such as a java.util.Date attribute, which can map to SQL DATE , TIME or TIMESTAMP . You use the @Type("timestamp") annotation to tell Hibernate that a timestamp converter should be used, which identifies an instance of org.hibernate.type.TimestampType . @Type can also be used to identify custom type converters, which can be defined with @TypeDef at the class level: @TypeDefs( { @TypeDef( na... or with an xml file: <?xml version="1.0"?> <!DOCTYPE hibernate-mappi...
Created by Fang on December 03, 2011 12:31:20    Last update: December 03, 2011 12:33:23
The <h:outputText> tag generates different output for body text and value attribute. I tested the following with Apache MyFaces 2.1.3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric... With value attribute, the output was: <table border='1' cellspacing='0' cellpadding='4'>... With text in body, the output was (i.e., the text was escaped despite escape="false" ): &lt;table border='1' cellspacing='0' cellpadding='...
Created by Fang on November 22, 2011 10:40:16    Last update: November 22, 2011 10:40:16
This is an example that uses tag handler, UI component and renderer together to support a custom taglib. The main purpose is to show how these components play together. The tag renders <ui:param name="extra" value="el interpreted"/> ... as <h3>my:foreach</h3> <ul class="css class" extra... These are the files: The tag handler ( src/main/java/com/example/ForeachTagHandler.java ): package com.example; import java.util.Map; ... The UI component ( src/main/java/com/example/UIForeach.java ): package com.example; import java.io.IOExcep... The renderer ( src/main/java/com/example/ForeachRenderer.java ): package com.example; import java.io.IOExcep... Faces config ( src/main/resources/META-INF/faces-config.xml ): <?xml version="1.0" encoding="UTF-8"?> <faces-c... Taglib config ( src/main/resources/META-INF/foreach.taglib.xml ): <?xml version="1.0" encoding="UTF-8"?> <facelet...
Created by Fang on November 08, 2011 20:55:00    Last update: November 21, 2011 18:19:44
In the simple taglib example , I used a tag handler class to implement a taglib. This is an example to implement a taglib with a UI component. The purpose is to use a custom tag to split a string and print each part in a separate paragraph, i.e., print <p>john</p> <p>steve</p> <p>mike</p> with custom tag <my:foreach> : <my:foreach var="who" value="john steve mike"> ... These are the files: pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0"... src/main/java/com/example/UIForeash.java : package com.example; import java.io.IOExcep... src/main/resources/META-INF/faces-config.xml : <?xml version="1.0" encoding="UTF-8"?> <faces-c... src/main/resources/META-INF/foreach.taglib.xml : <?xml version="1.0" encoding="UTF-8"?> <facelet... How to use: Put the JAR file generated by the above project in the WEB-INF/lib folder of the web app. If the web app is a Maven project, just add the taglib project as a dependency:...
Created by mee2 on November 20, 2011 21:00:58    Last update: November 20, 2011 21:10:22
Alfresco community-4.0.b has only 64-bit installer for Linux. These are the steps to manually install it on 32-bit Ubuntu Linux. Download alfresco-community-4.0.b.zip from http://wiki.alfresco.com/wiki/Download_and_Install_Alfresco . Install dependencies: $ sudo apt-get install imagemagick swftools postgr... Note: swftools was not available as a package for Ubuntu 11.10, I installed it with source . Create alfresco database: $ sudo bash [sudo] password for alfresco: ... Copy everything from the Alfresco web-server folder to Tomcat: $ cp -R alfresco-community-4.0.b/web-server/* apac... Edit $TOMCAT_HOME/conf/catalina.properties , change shared.loader to: shared.loader=${catalina.base}/shared/classes,${ca... Edit Tomcat conf file conf/server.xml , add URIEncoding="UTF-8" : <Connector port="8080" protocol="HTTP/1.1" ... Customize alfresco-global.properties : $ mv shared/classes/alfresco-global.properties.sam... Edit shared/classes/alfresco-global.properties : ############################### ## Common A... Copy keystore files from alfresco.war : expand alfresco.war , grab the whole keystore directory from...
Created by Fang on November 10, 2011 09:26:12    Last update: November 10, 2011 09:26:12
Syntax highlighted XML schema for JSF 2.0 Application Configuration Resource File ( faces-config.xml ). Almost 3000 lines! <?xml version="1.0" encoding="UTF-8"?> <xsd:sch...
Created by Fang on November 02, 2011 16:40:10    Last update: November 02, 2011 16:40:10
Facelet taglib schema from JavaServer Faces Spec 2.0: <xsd:schema targetNamespace="http://java.sun.com/x...
Created by Fang on October 30, 2011 20:35:17    Last update: October 30, 2011 20:37:03
This note lists some of the different behaviors I found using different JSF implementations. In the simple JSF facelet example, I used Sun's reference implementation version 2.0.0-RC: <dependency> <groupId>javax.faces</gro... With this version, the DOCTYPE declaration is dropped when the page is rendered. It doesn't matter what DOCTYPE you declare in your templates, the facelet engine simply drops it. The problem with this is, your page is always displayed in quirks mode , despite your intentions to require standards compliant mode. The DOCTYPE problem is fixed in release 2.0.2-FCS . Change the dependency in pom.xml to: <dependency> <groupId>javax.faces</gro... and test again, you'll find that DOCTYPE is faithfully passed over to the browser (view source at browser). You can delete the DOCTYPE declaration in the xhtml template...
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 ,...
Previous  1 2 3 Next