Recent Notes
Displaying keyword search results 1 - 6
Created by Dr. Xi on November 19, 2008 00:22:27
Last update: January 07, 2010 23:00:36
There is a open source project named [ini4j] for processing Windows .ini configuration files. However, I found it an overkill for my purposes. So here is my simple implementation of a .ini parser. It mimics the standard java.util.Properties class with enhancements to get and set properties by section name. There are only a few simple rules: Leading and trailing spaces are trimmed from section names, property names and property values. Section names are enclosed between [ and ] . Properties following a section header belong to that section Properties defined before the appearance of any section headers are considered global properties and should be set and get with no section names. You can use either equal sign ( = ) or colon ( : )...
Created by Dr. Xi on July 28, 2009 19:00:55
Last update: July 28, 2009 19:03:57
When you install Apache with mod_ssl, an executable file openssl (or openssl.exe for Windows) is installed in /usr/local/ssl/bin (or %APACHE_HOME%/bin ). This utility is used to generate private key and certificate request:
Generate private key:
openssl genrsa -out server.key 1024
# or wi...
Generate certificate request:
openssl req -new -key server.key -out server.csr
...
Self-Sign Certificate:
openssl x509 -req -days 3650 -in server.csr -signk...
Apache configuration:
Listen 443
<VirtualHost *:443>
ServerNam...
In some configurations
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unc...
is used to work around MSIE bugs. See http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html#msie for details.
Created by Dr. Xi on April 30, 2009 23:26:13
Last update: May 01, 2009 17:08:49
ApplicationResources.properties contains these keys:
test.key.1 = Test Key One
test.key.2 = Test Key...
Struts (struts-el):
<%@ page contentType="text/html;charset=UTF-8" lan...
JSTL
<%@ page contentType="text/html;charset=UTF-8" lan...
However, the values for one and two must be passed in from pageScope , requestScope , sessionScope , etc. Values defined by struts bean:define are not interpreted.
Important:
JSTL tags work with servlet spec 2.4 only. So your web.xml must start with this:
<?xml version = '1.0' encoding = 'windows-1252'?> ...
Not this:
<?xml version = '1.0' encoding = 'windows-1252'?>
...
However, the latter does work with struts-el tags.
Created by Dr. Xi on October 23, 2008 03:54:04
Last update: October 23, 2008 03:57:44
Add validator plugin in struts-config.xml
<struts-config>
.
.
.
...
Set validate="true" on action form
<struts-config>
<!-- ========== Form Bean De...
Add validation rules in validation.xml
<?xml version='1.0' encoding='windows-1252'?>
<...
If you override validate , make sure super.validate is called.
package com.example;
import javax.servlet.h...
Read the documentation:
http://struts.apache.org/1.2.4/userGuide/dev_validator.html
Created by Dr. Xi on October 06, 2008 04:10:46
Last update: October 06, 2008 04:11:59
Start regedit , open key [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System] , create or modify a string value named "DontDisplayLastUserName" and set the value to "1".
To reverse the change, set the value to "0" , or remove the string value.
Created by Dr. Xi on September 21, 2008 21:04:24
Last update: September 21, 2008 22:27:36
IE uses Notepad as the default editor when you select "View Source" from a web page. You can change it to your favorite editor by adding a couple of keys to the registry: Start regedit Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ Add key View Source Editor Under View Source Editor , add key Editor Name Change the default string value to the full path of your favorite editor. The following is the registry entry for vim (full tip for vim is available from the vim wiki ):
Windows Registry Editor Version 5.00 [HKEY_... It is probably easier (less error prone) to edit this in a file and import it back into the registry. The contents of gvim.vbs are: '--- gVim.vbs ------------------------------------... It is OK to use gvim.exe...