Disable backspace key in a Richfaces application
If you want disable the Backspace key in your JSF Richfaces application put this in your view:
<rich:hotKey key="backspace" handler="return false;" disableInInput="true"/>
This will register a jQuery Hotkey handler for the document. The handler is not reqistered for input elements because in input fields you need the backspace
. Tested for FF3 and IE6.
Then I found out that the following snippet doesn’t work:
<rich:hotKey key="backspace"
disableInInput="true"
handler="alert('Backspace is disabled'); return false;" />
The Browser open the alert box go to the previous page (in background?!). But there is fix for that:
<rich:hotKey key="backspace"
disableInInput="true"
handler="alert('Backspace is disabled'); event.stopPropagation(); event.preventDefault(); return false;" />
The event variable is available in the handler function (see org.richfaces.renderkit.html.HotKeyRenderer method doEncodeEnd).
Toggle jrebel with a cygwin bash function and maven
I’m using java rebel for web development with maven.
Sometimes I would run jetty with jrebel sometimes without.
For that I’m using two simple bash functions:
# ~/.bashrc
#
# Maven options
#
export INTERNAL_MAVEN_OPTS="-Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m"
#
# Java Rebel
#
export JAVA_REBEL="-Drebel.spring_plugin=true -Drebel.log=false -noverify -javaagent:D:\tools\javarebel\jrebel.jar -Drebel.packages=de.ahoehma"
function jrebel_on() {
export MAVEN_OPTS="$INTERNAL_MAVEN_OPTS $JAVA_REBEL"
}
function jrebel_off() {
export MAVEN_OPTS="$INTERNAL_MAVEN_OPTS"
}
Now its very simple to enable
$ jrebel_on
or disable jrebel
$ jrebel_off
Private Digitalkopie bleibt erlaubt
Quelle: handelsblatt
Wie im Urheberrechtsgesetz §53 nachzulesen:
(1) Zulässig sind einzelne Vervielfältigungen eines Werkes durch eine natürliche Person zum privaten Gebrauch auf beliebigen Trägern, sofern sie weder unmittelbar noch mittelbar Erwerbszwecken dienen, soweit nicht zur Vervielfältigung eine offensichtlich rechtswidrig hergestellte Vorlage verwendet wird. Der zur Vervielfältigung Befugte darf die Vervielfältigungsstücke auch durch einen anderen herstellen lassen, sofern dies unentgeltlich geschieht oder es sich um Vervielfältigungen auf Papier oder einem ähnlichen Träger mittels beliebiger photomechanischer Verfahren oder anderer Verfahren mit ähnlicher Wirkung handelt.
Die Klage der Musikindustrie wurde aus formalen Gründen abgelehnt.
Siehe auch hier: Gesetz über Urheberrecht und verwandte Schutzrechte
Quality Center Mylyn Integration
There is a interesting project at sourceforge called qcMylyn. The projects aims to provide a Mylyn connector for Quality Center. Support Eclipse 3.4.2, 3.5, Mylyn 3.0.5+.
I tried the released version 0.2.4 but it didn’t work because at work we are using an older version of QualityCenter (9.1). But this was no big problem I have the sourcecode (OS rocks) and I’m a programmer
I found out that a other project called QcTools4J contains the java code for manipulation a QC system. They using a com4j bridge to bind QC’s otaclient.dll.
If you have trouble with a older/newer version of QC you have to update the qctools4j.
You find a short tutorial how to update qctools4j here. (read this first) … then you will come to the point where you want create a new otaclient.jar from you local otaclient.dll. Here is my simple solution for that.
I create my own otaclient maven project with the following pom:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>otaclient</groupId>
<artifactId>otaclient</artifactId>
<version>9.1.0.4372</version>
<dependencies>
<dependency>
<groupId>org.jvnet.com4j</groupId>
<artifactId>com4j</artifactId>
<version>20080107</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.jvnet.com4j</groupId>
<artifactId>maven-com4j-plugin</artifactId>
<executions>
<execution>
<id>gen-java-bridge</id>
<goals>
<goal>gen</goal>
</goals>
<configuration>
<file>src/qc/OTAClient.dll</file>
<package>com.mercury.qualitycenter.otaclient</package>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I using the maven-com4j-plugin to generate the java layer for otaclient.
All you have to do is to extract your “qc client package” (could be download from every qc server page) into src/qc and start mvn clean package.
Then target will contain a otaclient-9.1.0.4372.jar. Copy this jar into qctools4j/lib/com.mercury.qualitycenter.otaclient-9.2.jar and rebuild qctools4j. That’s all

Then copy the qctools4j.jar into org.tszadel.qctools and rebuild the whole eclipse feature.

Try it
Nice example for a checked unchecked exception
Today I found a nice example for a “checked null pointer exception” in Ed burns blog.
@Override
public void encodeAll(FacesContext context) throws IOException {
ResponseWriter writer = context.getResponseWriter();
String viewName, libraryName, resourceName;
try {
viewName = this.getAttributes().get("viewName").toString();
libraryName = this.getAttributes().get("libraryName").toString();
resourceName = this.getAttributes().get("resourceName").toString();
} catch (NullPointerException e) {
throw new FacesException("Must supply viewName, libraryName and resourceName attributes");
}
...
}
I have always tried to avoid NPE’s with code like this:
if (foobar == null) {
throw new IllegalArgumentException("foobar must not be null").
}
But from now I will try to use the “checked” version of a npe check above more often.
Read more about checked / unchecked exceptions here:
- [a] http://www.javapractices.com/topic/TopicAction.do?Id=129
- [b] http://en.wikipedia.org/wiki/Exception_handling#Checked_exceptions
- [c] http://de.wikipedia.org/wiki/Ausnahmebehandlung#Checked_Exceptions
- [d] http://java.sun.com/docs/books/jls/second_edition/html/exceptions.doc.html
- [e] http://www.mindview.net/Etc/Discussions/CheckedExceptions
Risikio Schweinegrippe-Impfstoff
In Naturheil-Blog sind ein paar Hintergründe zum Impfstoff zu lesen, z.B. hier und hier. Den Grippe-Report sollte man sich auch mal durchlesen.






