Category: Java

a row of white and yellow led strips

Adding LDAP Authentication to a Play! 2 Application

As of Play! 1 is not really supported anymore, i will describe the steps for accessing Data from your LDAP Directory with your Play! 2 with this Post. Prerequisites As also mentioned in my last Post, for this example we are using the Vagrant vagrant-rundeck-ldap VM, I already mentioned here. Setup After you setup a

play-i18ned

This Module provides support for converting Play! i18n Files into an Excel Sheet and from an Excel Sheet to i18n Files. Usage You need to create the message files first (e.g. conf/messages, conf/messages.de, conf/messages.en) You may enter some key/value entries to the Files. The prefered format is: # Description key=value Add the Module to your

Building Native MacOS Apps with Java

Some Time ago, Java and MacOS were friends. You could just open XCode choose “Java Application” and start coding your app. But since the last version of Xcode 3 and finally with the release of Xcode 4 all the nice Cocoa/Java Bindings were gone. The normal way of Apple to cleanup their System and make

Fixing Redirects of a Play! App behind an Apache2 SSL Proxy

So you just finished your first Play! App. You want to run that thing behind an Apache2 as a HTTPS Proxy, because you do not want, that your User-Credentials are read as clear text. So a very basic Apache Configuration looks like this:     <IfModule mod_ssl.c>         Listen 443         SSLRandomSeed startup builtin         SSLRandomSeed

Hacking just for Fun: Get Mails from IMAP with Java

I have the feeling, that i might need this someday :-). Collecting Mails from an IMAP Server with Java is pretty easy: package de.javastream.imapcollector; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Properties; import javax.mail.Folder; import javax.mail.Message; import javax.mail.Multipart; import javax.mail.Part; import javax.mail.Session; import javax.mail.Store; import javax.mail.internet.MimeBodyPart; import javax.swing.JOptionPane; public class App { public static void getMail(String host,

Hacking just for Fun: Raid5 in Java

I was just curious how easy it might be to write a RAID5 compatible Outputstream in Java? Just a few Lines. For sure it is not the most elegante solution. Especially if you see the nice possibility to integrate one Outputstream within another… so maybe two Raid5s into one Raid0 Stream? (would be RAID50) then.

Run local/remote terminal commands with java using ssh

Sometimes you need to use some CLI-Tools before you want to create or search for a native JNI Binding. So there is a common way, using the Java Process-Class. But then you might meet two problems i had to face in the past during several problems: There are (a really small) number of CLI-Tools, that

Counter Update

I just finished my latest improvements to the legacy version of my counter script. I just added the lookup for ISPs and added dynamic scaling for the axis legend. I will now going forward to change the whole system to a more sophisticated software, e.g. using a Datawarehouse approach. The first version of the Data-Model

Testing Play! Applications with HTTP Basic Auth

Um eine Play!-Anwendung zu testen, welche HTTP-Basic-Auth verlangt ist es notwendig, die Standard-Datei ApplicationTest.java anzupassen: Verändert werden muss die Test-Methode testThatIndexPageWorks(): Aus @Test public void testThatIndexPageWorks() { Response response = GET(“/”); assertIsOk(response); assertContentType(“text/html”, response); assertCharset(play.Play.defaultWebEncoding, response); } Wird: @Test public void testThatIndexPageWorks() { Request request = FunctionalTest.newRequest(); request.user = “test”; request.password = “test”; request.url =

Play! Applications und der App-Context

Es ist möglich, eine Play!-Anwendung sehr einfach in eine WAR-Struktur zu übertragen und in einen Application-Server zu deployen. Dies ist recht gut unter Deployment options in der Play!-Dokumentation recht gut erklärt. Was hier allerdings verschwiegen wird ist, wie man den notwendigen Context beim Routing konfiguriert. (Der Context ist der Pfad der Anwendung, welcher standardmäßig vom

1 2 3 4