Postcards from Utopia

Follow me on TwitterRSS Feeds

  • Home
  • About
  • Contact

Spring Security authentication with a Neo4j backend

Apr 26th

Posted by georg in java

2 comments

I am currently working on a Spring-based Neo4j (a graph database) application and needed to add user authentication. Since Spring Security allows integrating custom authentication providers it felt only natural to implement a provider based on Neo4j. A data structure to support users and groups is already provided in the Neo4j Wiki. I used it as the basis for my implementation with some wrapping so it could be integrated with Spring Security and provides administrative methods.

More >

graph database, graphdb, java, neo4j, spring, spring security

Nagios Plugin to check memory consumption

Apr 15th

Posted by georg in admin

1 comment

For some reason the Nagios package in Debian / Ubuntu does not provide a plugin to check the memory consumption so I built a simple script to do that. It ignores swap space (since if your machine starts swapping you’re lost anyway) and caches (it’s nice to have memory available for caches but this isn’t really required). That way only the real memory consumption is checked and if that passes a certain threshold you can rest assured that you’re in for trouble.

More >

administration, monitoring, nagios

Iterating over nested objects in a Spring form

Apr 13th

Posted by georg in java

No comments

Spring 3 allows for wonderfully simply forms and automatic binding of form values back to the command object. However if your command object has further nested objects that you want to make editable from the form as well things, get a little tricky. In that case you can’t just use a standard JSTL forEach loop as this will not allow you to build the path to the nested object correctly. The trick is to use the varStatus attribute to keep track of the index.

More >

binding, form, java, spring

Unit Testing a Spring @Controller

Apr 11th

Posted by georg in java

No comments

Thanks to Spring’s new MVC Annotations (@Controller, @RequestMapping, @RequestParam etc.) unit testing a Spring controller is now easier than ever before. Still, I had a hard time figuring out how to do this since most of your controller methods will not take a ServletRequest as input. Instead they use a form-backing / command object, a BindingResult and maybe a ModelMap. In a web environment Spring takes care of filling the command object and validation results however in a unit test you will have to do this yourself.

Following is the basic outline for writing such a test.

More >

java, spring, tdd, test
    • Recent comments
    • Popular posts
    • Archives
    • Tags
    • Categories
    • admin (1)
    • java (3)
    administration binding form graph database graphdb java monitoring nagios neo4j spring spring security tdd test
    • April 2010 (4)
    • Spring Security authentication with a Neo4j backend (2)
    • Nagios Plugin to check memory consumption (1)
    • Unit Testing a Spring @Controller (0)
    • Iterating over nested objects in a Spring form (0)
    • Kitchen: cabinet http://rkeylsoewm2vmk.BABYCLOTHESNUT.INFO/tag/cabinet+refacing+Kitchen+Countertops/ :...
    • uberVU - social comments: Social comments and analytics for this post... This post was mentioned on Twitter by...
    • Tweets die Nagios Plugin to check memory consumption « Postcards from Utopia erwähnt -- Topsy.com: [...] Dieser Eintrag wurde auf Twitter von Georg M. Sorst erwähnt. Georg M. Sorst sagte: #Nagios ...
  • Blogroll

    • Der Flix
    • dontdrinkandroot
    • Jojos illustrierter Blog
    • Lolcats 'n' Funny Pictures of Cats
    • PHD Comics
    • Wasted Talent
  • My latest tweets

    Loading tweets...
    Follow me on Twitter!
  • User Login






    • Lost your password?
Mystique theme by digitalnature | Powered by WordPress
RSS Feeds XHTML 1.1 Top