Home » JVM Languages » Page 40

JVM Languages

Groovy’s magical NullObject

In this post I am going to explain some not that obvious differences of null in Java and null in Groovy. Let’s start with the following line:               Object o = null This statement works fine in Java and Groovy (except that Java requires a semicolon at line end). However, it has slightly different ...

Read More »

Getting Started with method security in Grails using Spring Security

This blog post will be about implementing method level security with security expressions in Grails using the Spring Security plugins. I assume you have some basic understanding of the Grails Spring Security Core plugin. Roles aren’t enough. When using the Spring Security Core plugin you typically start to configure which roles are required for accessing certain URLs. This configuration can ...

Read More »

Grails: Calling bean methods in Spring Security expressions

Some days ago while working on a Grails application I was in a situation where a wanted to call a bean method from a Spring security SPEL expression. I was using the @PreAuthorize annotation from the Spring Security ACL plugin and wanted to do something like this:               @PreAuthorize("myService.canAccessUserProfile(#profileId)") public Profile getUserProfile(long profileId) {   ... } @PreAuthorize takes ...

Read More »

Ceylon 1.0.0 is now available

Today, we’re proud to announce the first production release of the Ceylon language specification, compiler, and IDE. Ceylon 1.0 is a modern, modular, statically typed programming language for the Java and JavaScript virtual machines. Ceylon enables the development of cross-platform modules that execute portably in both virtual machine environments. Alternatively, a Ceylon module may target one or the other platform, ...

Read More »

Grails: Applying build information to your builds

Occasionally, when I buy some food I check the label to see how unhealthy it is in an effort to remind myself to eat better. I probably should do this more often but that’s another story. With software, I take a more strict approach. I like to know exactly what version of what I am using and if it pertains ...

Read More »

Sending Email with Java and Akka actors

Akka is a concurrent framework written by Scala. Here I demonstrate sample application to send emails with Akka and implemented in Java. Reasons I decided to use Akka framework other than concurrency. Built-in configurable supervisor strategy to monitor child workers and decide what policy applies when there is an exception. Can reschedule delivery when application throwing some specific exception. Use ...

Read More »

Scala setup on Windows 7

This article will be dedicated to installation of Scala on PC with Windows 7. In general, doesn’t metter which Windows you have. All steps you need to perform are approximately the same for all versions of Windows. In my previous post I have described how to install Scala on Mac OS. The first step you need to do is download ...

Read More »

Scala Wonderland: All operations are method calls

I’ve started learning Scala two months ago and I can’t get back to Murakami’s 1Q84 so exciting it is. In the coming series I’d like to share my excitement with you. It won’t be yet another step-by-step tutorial. I’ll share features that made me think (IBM should be proud of me). For whatever reason.             ...

Read More »

A Scraping Library

As part of a project I’m working on, I needed to get documents from state institutions. And instead of writing code specific for each site, I decided to try creating a “universal” document scraper. It can be found as a separate module within the main project https://github.com/Glamdring/state-alerts/. The project is written in Scala, and can be used in any JVM ...

Read More »