Displaying keyword search results 1 - 10
Created by Fang on January 10, 2014 14:07:20 Last update: January 10, 2014 14:07:20
An example project with Spring MVC and Apache Tiles. List of files:
./pom.xml ./src/main/webapp/WEB-INF/web.xml..../pom.xml :
<?xml version="1.0" encoding="UTF-8"?> <pro..../src/main/webapp/WEB-INF/web.xml :
<?xml version="1.0" encoding="UTF-8"?> <web-app..../src/main/webapp/WEB-INF/applicationContext.xml :
<?xml version="1.0" encoding="UTF-8"?> <beans x..../src/main/webapp/WEB-INF/spring-servlet.xml :
<?xml version="1.0" encoding="UTF-8"?> <beans x..../src/main/webapp/WEB-INF/tiles-definitions.xml :
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYP..../src/main/webapp/WEB-INF/jsp/template.jsp :
<!DOCTYPE html> <%@ page pageEncoding="UTF-8" %..../src/main/java/com/example/MyController.java :
package com.example; import javax.servlet.S...
Created by Fang on December 30, 2013 14:50:08 Last update: December 30, 2013 14:50:08
Starting with 3.1 M1 you can register HttpMessageConverters through a sub-element of mvc:annotation-driven .
<?xml version="1.0" encoding="UTF-8"?> <beans x...
Created by Fang on July 25, 2012 12:52:40 Last update: September 14, 2012 13:37:57
Summarized from official JAX-WS documentation : Sending and Receiving SOAP Headers To send a SOAP header:
HelloService helloService = new HelloService(); ...To receive a SOAP header:
List<Header> inboundHeaders = bp.getInboundHeaders...Message logging On the client side, set system property:
com.sun.xml.ws.transport.http.client.HttpTransport...On the server side, set system property:
com.sun.xml.ws.transport.http.HttpAdapter.dump=tru...Propagation of Server-side Stacktrace Propagation of Stack trace is on by default. The whole stacktrace (including nested exceptions) is propagated in the SOAP Fault and the complete exception stacktrace is visible to the client as cause of SOAPFaultException . To turn off stack trace propagation, set this system property on the server:
com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptu...Update: At least on the client side, the property name has been changed to:
com.sun.xml.internal.ws.transport.http.client.Http...The messages are dumped to stdout . For...
Created by Dr. Xi on April 19, 2012 10:10:08 Last update: April 19, 2012 10:11:06
The default servlet for Tomcat is declared in $CATALINA_HOME/conf/web.xml :
<servlet> <servlet-name>default</servle...Therefore, static content is rendered by the default configuration unless you override it with your own definitions. If you want to allow directory listing, just change the listing parameter to true :
<init-param> <param-name>listings</para...Change the welcome-file-list to display a default page in lieu of a directory listing:
<welcome-file-list> <welcome-file>home.xhtml</...Welcome pages are defined at the Web application level.
Created by Fang on December 05, 2011 13:04:11 Last update: December 05, 2011 13:04:11
Facelet requires strict XML syntax, so unmatched tags (start with no end, etc) generate errors. This is a trick to workaround that. The following code generates a row for every three items and for each row assigns a row id:
<!-- using ui:repeat --> <ui:repeat var="name" ...
Created by James on November 27, 2011 12:43:24 Last update: November 27, 2011 12:59:01
An easy to digest stylesheet example for XSLT for Atom. Simply list entry titles and summary:
<?xml version="1.0" encoding="utf-8"?> <xsl:sty...To show the first 3 items in atom feed:
<?xml version="1.0" encoding="utf-8"?> <xsl:sty...
Created by James on November 23, 2011 13:57:51 Last update: November 23, 2011 13:57:51
An easy to digest stylesheet example for XSLT for RSS. Simply list item titles descriptions:
<?xml version="1.0" encoding="utf-8"?> <xsl:sty...URL for Google news feed: http://news.google.com/news?ned=us&topic=h&output=rss
Created by nogeek on November 03, 2010 20:52:49 Last update: November 23, 2011 08:54:44
My problem is simple: in my XML data, a timestamp is provided as a long integer (number of milliseconds since the "the epoch"). When I do XSLT, I want to display it as a readable string, such as "Mon Nov 01 18:08:48 CDT 2010". After hours of struggle, I found: It's not so easy to get the job done with JDK 1.6 There are tons of garbage on the web in this space (suggestions, code snippets that simply don't work) Simple Xalan extension functions was the only resource that's somewhat informative. Even there some of the examples don't work. Below is a list of what worked and what didn't. This works:
<xsl:stylesheet version="1.0" xmlns:xsl="h...This does not (providing long value to Date constructor):
<xsl:stylesheet version="1.0" xmlns:xsl="h......
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 03, 2011 21:11:55 Last update: November 03, 2011 21:11:55
Facelet tag library descriptors can be specified in one of two ways: In web.xml , as <context-param> :
<context-param> <param-name>javax.faces...where javax.faces.FACELETS_LIBRARIES is interpreted as a semicolon ( ; ) separated list of paths, starting with "/" (without quotes). Each entry in the list is a path relative to the web application root, and is interpreted as a facelet XML tag library descriptor. The parameter facelets.LIBRARIES is an alias to javax.faces.FACELETS_LIBRARIES for backwards compatibility reasons. Via auto-discovery, by placing the XML tag library descriptor within a jar on the web application classpath (for example, under the folder WEB-INF/lib ). The file should have a name suffix .taglib.xml , and be placed in the META-INF folder of the JAR file.