My first open source project

I recently released my old, long-term project called survey-rocket (a simple online survey tool) to google code. I started to refactor the code to make it more readable and maintainable. Although I invested many hours, there is still a long way to go until it can be considered good code. Basically I used this project… Continue reading My first open source project

Set URL of Tomcat Webapplication to ROOT in Eclipse

When you create a Dynamic Web Application in Eclipse and run it on Tomcat, the Website will be available trought http://localhost:8080/[PROJECT_NAME]. To “move” the application in the root (making it accessible on http://localhost:8080), go into the project’s properties, go to “Web Project Settings” and just enter “/” in the Context Root textbox. Done.

Simple multithreaded Java Webserver

The following¬†code (estimated 150 lines of code) implements a simple multithreaded Web Server in Java. The code is easy to read and contains no (really) complicated stuff. There are 5 classes: HTTPException.java This class extends Exception and overrides the getMessage(String) Methode, which is responsibe for example for the Error 404 Not Found message. MimeTypeResolver.java This… Continue reading Simple multithreaded Java Webserver

Sort collections in java

Usual problem: When you pass a java list to Collections.sort(List list), the elements are sorted according to their returned values retrieved by calling the objects compareTo() methods. Well, what to do if you suddenly want to sort the same list by another criteria? Then a comparator is your friend.¬† A comparator knows how to compare… Continue reading Sort collections in java

get sun java on debian based system

just type: sudo add-apt-repository “deb http://archive.ubuntu.com/ubuntu hardy main multiverse” sudo add-apt-repository “deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse” sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner” sudo apt-get update sudo apt-get install sun-java6-jdk