Category Archives: Software Development

Client Certificates and Play!

Sometimes we need the authentication of the client. That means, for instance, if you want to limit the access to your web application, from the people who has the right certificate. This is possible, using client certificates, which are installed inside the browser, and the user without this certificate cannot access the web application. To [...]

Also posted in Internet, play | Tagged , , , , , , | 5 Comments

Access DB manager from the PlayFramework

With the new 1.2 version of play, now it’s possible to see all the tables in the database without needing an external database manager program. I have been developing in play, and I always feel the need of having a database in memory with test data being loaded each time I run the server. With [...]

Also posted in play | Tagged , , , , | 2 Comments

Deploying PlayFramework Apps in JBoss

After you created your web application you need to create the WAR file that will insert the framework and other dependent libs inside the folder that you specify: play war myapp -o myapp.war Now to deploy on JBoss, you need to do some changes on your WAR file: Create a file called jboss-web.xml in the [...]

Also posted in Internet, play | Tagged , , , | Leave a comment

Send file to user using views

There are some simple steps to send a file to the user of your web application using the Play Framework: 1. After the controller is created (what I do is to copy the controller  “Application” and do a refactor rename to the name I want). Create a file named MyController (what I do is to [...]

Also posted in Internet, play | Tagged , , , , | Leave a comment

Security tips for a web developer

Every web application has two sides. The client side and the server side. Everything on the client side can be changed, and most of the security problems happens when you trust in the client. With a simple proxy (like webscarab) you can edit the fields that were validated using javascript. That’s why you always need [...]

Also posted in Internet, play | Tagged , , , , | Leave a comment

Play Framework + Oracle = EASY!

To configure your oracle database using the play framework you need to follow the following steps: Choose the JAR with the drivers according to your oracle’s database version and put in the lib/ directory of your web application Configure your application.conf file,  located inside the conf/ directory In the JPA Configuration Section you have to [...]

Also posted in Internet, play | Tagged , , , , | 9 Comments

[Play] Iterate over objects using jQuery

What if I want to navigate into each checkbox, radio of my html? You can do it pretty easily using jQuery.each function. In every checkbox element I want to send a post message to my Play Framework. jQuery.each($(‘:checkbox’), function() { $.post(‘@{myPlayMethod()}’, { itemValue: $(this).val() }) }); This code sends the html element value property to [...]

Also posted in play | Tagged , , , , | Leave a comment

How to divide your GUI from your processing code?

Many students don’t know how to organize their code. Abstractions and Interfaces makes a difference when developing Java applications. What if your code was divided? For instance, if you have created a network application with a GUI (Graphical User Interface). The first approach is to put the code all together because it’s easier from the beginning. That’s wrong because it’s harder to find an error and you have to read a lot of garbage code like textBox.setValue

Posted in Software Development | Tagged , , , , | Leave a comment

Singleton Design Pattern problems?

The Singleton Pattern ensures a class has only one instance that provides a global point to access it. This design pattern is perfect for maintaining a set of configurations or other variables always available at run-time in your software. public static Singleton getInstance() { if (uniqueInstance == null) { uniqueInstance = new Singleton(); } return [...]

Posted in Software Development | Tagged , , , , | Leave a comment