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 January 28, 2012 13:24:09    Last update: January 28, 2012 13:31:22
This is a simple JSP custom tags library with tag body. Just like the JSF counterpart , it splits a string and repeats the body for each word, i.e., with this markup: <%@ taglib uri="" prefix... output: <html> <body> <p>Hello Tigger!</p> <p>H... With Maven, this is the directory structure: ./src ./src/main ./src/main/resources ./s... There are three files to write: pom.xml : <project xmlns=""... src/main/java/tagdemo/ : package tagdemo; import src/main/resources/META-INF/demotag.tld : <?xml version="1.0" encoding="UTF-8"?> <!DO... Build with: mvn clean install To use it as a dependency in other Maven projects: <dependency> <groupId>tag-demo</groupId> ...
Created by Fang on December 06, 2011 19:03:25    Last update: December 07, 2011 08:54:11
Our custom tag, as implemented in the previous note , is broken when a template is used. Create a template file ( home-template.xhtml ): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric... and a test page that uses it ( home.xhtml ): <?xml version="1.0" encoding="UTF-8"?> <ui:comp... Then request the page with URL: http://localhost:8080/facelet-demo/home.jsf?name=Jack . You'll find that our hello tag works inside ui:repeat but fails to get the value defined by ui:param ! What's the problem? Our hello tag implementation evaluated the EL with the wrong EL context! This is the corrected implementation: package com.example; import
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/ ): package com.example; import java.util.Map; ... The UI component ( src/main/java/com/example/ ): package com.example; import The renderer ( src/main/java/com/example/ ): package com.example; import 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=""... src/main/java/com/example/ : package com.example; import 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 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.
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="
Created by Fang on October 28, 2011 13:49:40    Last update: October 30, 2011 19:23:25
This is a simple example to demonstrate the templating power of JSF facelets. If you've used struts tiles before, you'll recognize the simplicity of templating with facelets. I've stripped out everything else except the pages themselves, just to put our focus on facelets. This is a Maven based project, and you need Tomcat (or any servlet container) to run the resulting webapp. To begin with this is the list of files: ./pom.xml ./src/main/webapp/home.xhtml ./src... I left faces-config.xml in there for completeness sake, it may not be needed. The Maven POM ( pom.xml ): <?xml version="1.0" encoding="UTF-8"?> <project... Web app configuration ( WEB-INF/web.xml ): <?xml version="1.0" encoding="UTF-8"?> <web-app... Empty WEB-INF/faces-config.xml : <?xml version="1.0" encoding="UTF-8"?> <!-- Thi... index.jsp is simply a redirect to home.jsf : <% response.sendRedirect("home.jsf"); %>...
Created by freyo on April 18, 2011 15:08:21    Last update: April 18, 2011 15:12:20
Generate android project $ ~/android-sdk-linux_86/tools/android create proj... Create XML file res/xml/books.xml : <?xml version="1.0"?> <catalog> <book id=... Edit layout ( res/layout/main.xml ): <?xml version="1.0" encoding="utf-8"?> <Lin... Edit code ( src/com/android/xmlres/ ): package; import Change activity label from app_name to booklist ( AndroidManifest.xml ): <?xml version="1.0" encoding="utf-8"?> <manifes... Add value for string resource ( res/values/string.xml ): <?xml version="1.0" encoding="utf-8"?> <resourc... Deploy and test: ant install
Previous  1 2 Next