Recent Notes

Displaying keyword search results 1 - 10
Created by SaranReddy on May 14, 2014 07:59:40    Last update: May 14, 2014 07:59:40
As you have mentioned above, i have changed and its working fine. But my doubt here is, Assume day one you have deployed release abc-RELEASE-0.0.1.war . assume on day 2 you want to deploy second release abc-RELEASE-0.0.2.war. if we hard code the war file name in <Context>, the each and every time when the war file name changes like abc-RELEASE-0.0.3,0.0.4 as per the release then, each and every time we need to change the value at <Context> tag in server.xml file. I want it to be configured only once irrespective of the release As we do in JBOSS. could you please help me in this..
Created by Fang on February 23, 2012 14:25:57    Last update: March 01, 2012 13:53:59
Some example snippets for Spring message configuration and usage. To configure a message source in Spring context (basename=messages): <bean id="messageSource" class="org.springf... Locale change interceptor can also be setup with: <?xml version="1.0" encoding="UTF-8"?> <beans x... The messages file should be named messages.properties (or messages_en.properties , etc.) and located on CLASSPATH , for example: WEB-INF/classes . To use a message resource in JSP: <%@ taglib prefix="spring" uri="http://www.springf...
Created by James on February 02, 2012 16:00:15    Last update: February 02, 2012 16:00:15
Video for Everybody seems to be a generic way to embed video in a web page, even without flash. This code snippet comes from that site. <!-- first try HTML5 playback: if serving as XML, ...
Created by Dr. Xi on February 01, 2012 12:55:28    Last update: February 01, 2012 12:55:28
You can define environment variables in the Tomcat context.xml file like this: <?xml version="1.0" encoding="UTF-8"?> <Context... which is equivalent to the following in web.xml : <env-entry> <env-entry-name>varName</env-entr... In Java code, the variable can be looked up like this: // import javax.naming.Context; // import javax...
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 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 October 30, 2011 19:19:33    Last update: October 30, 2011 19:21:11
I've seen both <context-param> <param-name>javax.faces.PRO... and <context-param> <param-name>facelets.DEVE... in web.xml . But I cannot find any documentation of facelets.DEVELOPMENT in the JSF 2 spec. I cannot find any code referencing facelets.DEVELOPMENT in mojarra-2.1.3-FCS (the reference JSF implementation) either. So my guess is facelets.DEVELOPMENT is a thing of the past . About javax.faces.PROJECT_STAGE , this is what's documented in the JSF 2 spec: javax.faces.PROJECT_STAGE - A human readable string describing where this particular JSF application is in the software development lifecycle. Valid values are “ Development ”, “ UnitTest ”, “ SystemTest ”, or “ Production ”, corresponding to the enum constants of the class javax.faces.application.ProjectStage . It is also possible to set this value via JNDI. See the javadocs for Application.getProjectStage() .
Created by alfa on May 27, 2011 11:19:29    Last update: May 31, 2011 07:56:26
This is a utility to convert a string value to one of the primitive type values. It is useful in Java reflection code where the value comes in as a string (e.g., from XML parsing), and the type of the value cannot be decided until runtime. import java.util.*; import java.lang.reflect.*;... Note: This method can be extended to convert string to more complex types by writing a converter for the destination type. For example, to convert string to date: public class DateConverter { public static ... Usage: Date d = (Date) ConvertUtil.convert("10/12/2010", ...
Created by Dr. Xi on April 26, 2011 21:25:55    Last update: April 27, 2011 11:08:57
The following code validates a web.xml file against the web-app 2.5 schema: // Java XML validation with schema import java.... web.xml used for testing: <?xml version="1.0" encoding="UTF-8"?> <web-ap... According to Java API doc , validation can also be done while parsing by calling setSchema on the parsing factory. However, validation doesn't work for the SAXParserFactory! // Java XML validation with schema import java....
Previous  1 2 3 Next