Recent Notes
Displaying keyword search results 1 - 10
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 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 11:57:49
Last update: October 05, 2011 12:20:00
This procedure sets up an IPSec vpn server on Linux with Preshared Key (PSK) using Openswan .
Install Openswan:
# yum install openswan
Edit /etc/ipsec.conf . This is about the minimum needed to run IPSec server. Instead of running L2TP on port 1701, I'm running TCP on port 8080 so that I can test the setup with nc later.
# /etc/ipsec.conf - Openswan IPsec configurati...
Edit /etc/ipsec.secrets .
#
# Preshared key for clients connecting from a...
Start IPSec:
# /etc/init.d/ipsec start
Check status:
# ipsec auto --status
Monitor IPSec log:
# less /var/log/secure
If IPSec is running KLIPS, you should see a new nic ( ipsec0 ). There's no ipsec0 if IPSec is running NETKEY.
# ifconfig
eth0 Link encap:Ethernet HWadd...
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 openswan
Edit /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 start
Connect to IPSec server:
# ipsec auto --up TCP8080-PSK-CLIENT
104 "TCP80...
Created by Dr. Xi on April 27, 2011 11:57:36
Last update: April 27, 2011 11:58:35
This is a sample struts-config.xml file for Struts 1.x .
<?xml version="1.0" encoding="UTF-8"?>
<!DO...
Created by Dr. Xi on March 31, 2011 15:03:26
Last update: April 01, 2011 12:34:50
Create an openssl configuration file which enables subject alternative names ( openssl.cnf ):
[req]
distinguished_name = req_distinguished_...
Create a certificate request using above configuration file:
C:\work>openssl req -new -key testServer.key -out ...
Verify the request was created successfully:
C:\work>openssl req -text -noout -in testServer.cs...
(Optional) self-sign the certificate request:
C:\work>openssl x509 -req -days 3650 -in testServe...
Created by James on October 06, 2010 20:54:39
Last update: October 06, 2010 20:55:00
When a JavaScript call is taking too much time, Firefox pops up this message: Of course the solution is to speed up your script. But suppose it really needs to exceed the preset timeout, you can delay the popup by following these steps: Enter about:config in the address bar Ignore the warning and proceed Enter dom.max_chrom in the filter input Change the value of dom.max_chrome_script_run_time to a bigger value (default is 20). For IE, there's a similar dialog with this message: "A script on this page is causing Internet Explorer to run slowly". But rather than counting elapsed time, IE counts the number of statements executed , which is controlled by the registry key HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Styles . You need to create a DWORD value named...
Created by voodoo on July 11, 2009 15:14:55
Last update: July 29, 2010 22:45:48
cURL is a command line tool for transferring files with URL syntax. The main purpose and use for cURL is to automate unattended file transfers or sequences of operations.
It's really easy to see HTTP headers with curl:
C:\>curl --head http://www.google.com
HTTP/1.0 ...
or, headers and page together (dump headers to stdout):
$ curl --dump-header - http://www.google.com HTTP/...
Download openssl from openssl.org:
curl http://www.openssl.org/source/openssl-0.9.6m....
C:\>curl --help
Usage: curl [options...] <url>
...
Created by Dr. Xi on January 08, 2010 03:53:37
Last update: January 08, 2010 03:54:56
This is an Ant custom task to merge Properties files I lifted from http://marc.info/?l=ant-user&m=106442688632164&w=2 , with some minor bug fixes.
Example usage:
<taskdef name="mergeProperty" classname="ant.task....
Implementation:
package ant.task.addon;
import java.io.Buff...