Displaying keyword search results 1 - 10
Created by James on February 02, 2012 16:09:05 Last update: February 02, 2012 16:09:17
flowplayer is another way to embed Flash in a web page. The code looks like this:
<object width="6400" height="380" data="swf/flowpl...You need to download two swf files: http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf http://releases.flowplayer.org/swf/flowplayer.controls-3.2.0.swf
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 java.io.IOExcep...
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 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:
Created by Fang on March 03, 2010 05:16:40 Last update: October 31, 2011 10:22:51
Implicit variables are always available to JSTL - you don't need to set them before using them. Page context: pageContext pageContext properties: Name Type Description page javax.servlet.Servlet The current servlet request request javax.servlet.ServletRequest The current servlet request response javax.servlet.ServletResponse The current servlet response servletConfig javax.servlet.ServletConfig The servlet config servletContext javax.servlet.ServletContext The application session javax.servlet.http.HttpSession The current HTTP session Note: request , response etc., is not directly available, you access them with pageContext.request , pageContext.response , etc. Scope variables: pageScope, requestScope, sessionScope, applicationScope Name Type Description pageScope java.util.Map Name-value pair of page scoped variables requestScope java.util.Map Name-value pair of request scoped variables sessionScope java.util.Map Name-value pair of session scoped variables applicationScope java.util.Map Name-value pair of application scoped variables Parameters, HTTP headers and cookies: param, paramValues, header,...
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 magnum on September 27, 2011 12:55:51 Last update: September 27, 2011 12:55:51
These steps set up a Linux host as IPSec client, using Openswan . Install Openswan:
# yum install openswanEdit /etc/ipsec.conf . Instead of L2TP on port 1701, I'm setting up TCP on port 8080 so that I can test the connection with nc .
# /etc/ipsec.conf - Openswan IPsec configuration f...Edit /etc/ipsec.secrets .
# include /etc/ipsec.d/*.secrets 192.168.0.101 ...Start IPSec:
# /etc/init.d/ipsec startConnect to IPSec server:
# ipsec auto --up TCP8080-PSK-CLIENT 104 "TCP80...
Created by James on May 19, 2011 16:02:40 Last update: May 19, 2011 16:05:05
Finally, MathJax makes showing math equations in the browser a reality! Here are some simple demos. A simple example:
<!doctype html> <html> <head> <title>Math...Add HTML styling for Firefox:
<!doctype html> <html> <head> <title>Math...