Archive

Archive for February, 2013

February 23, 2013 Leave a comment

hop2croft's software development Blog

Visit my new website http://java4developers.com

In this post we are going to make a project that allows us to get from a mySql database a car list. The technologies we are going to use are Maven for the dependency management, JPA to interact with the database, Spring to define the our application context (besides of wiring everything), and finally we use JUnit to our application tests.

View original post 663 more words

Advertisements
Categories: Uncategorized

February 13, 2013 Leave a comment

Aatul Palandurkar

Java continues to be the dominant programming language since beginning but following are the top 50 programming languages in February 2013 as per the TIOBE Programming Community Index :

Position
Feb 2013

Programming Language

Ratings
Feb 2013

1

Java

18.387%

2

C

17.080%

3

Objective-C

9.803%

4

C++

8.758%

5

C#

6.680%

6

PHP

5.074%

7

Python

4.949%

8

(Visual) Basic

4.648%

9

Perl

2.252%

10

Ruby

1.752%

11

JavaScript

1.423%

12

Visual Basic .NET

1.007%

13

Lisp

0.943%

14

Pascal

0.932%

15

Delphi/Object Pascal

0.886%

16

Transact-SQL

0.773%

17

Bash

0.741%

18

MATLAB

0.648%

19

Assembly

0.640%

20

Ada

0.631%

21

Lua

0.625%

22

PL/SQL

0.608%

23

SAS

0.569%

24

COBOL

0.514%

25

Fortran

0.462%

26

R

0.461%

27

LabVIEW

0.458%

28

Scheme

0.448%

29

Scratch

0.411%

30

ABAP

0.389%

31

Logo

0.385%

32

Prolog

0.341%

33

Haskell

0.329%

34

Erlang

0.329%

35

Scala

0.327%

36

D

0.297%

37

View original post 43 more words

Categories: Uncategorized

February 11, 2013 Leave a comment

Krishna's Blog

For people in hurry here is the code sample and the steps to setup the code.

Spring Security 3.1 is a framework that supports authentication and authorization in Java. Spring MVC has a good integration with Spring Security. In this blog, I will demonstrate how to JUnit test Spring Security layer for a Spring MVC application using spring-test-mvc.

The usecase we use in this blog is a Spring MVC based calendar application, where user can login and enter his events his events. User can see other user events but he cannot change it. An admin user can see other user’s Events as well as change it.

To enable spring-test-mvc, we need to setup spring-test-mvc. As a first setp get the latest code from github. and run the “mvn install” command in the downloaded folder. After that we need to add the below dependency in the pom.xml,

For…

View original post 96 more words

Categories: Uncategorized

February 10, 2013 Leave a comment

It’s pretty easy to get started with Cloud Foundry, but here’s also a 10 min barebones version we shared at JavaOne and will be sharing at Devoxx 2012 (record is 7 mins!)

  1. Sign up! If you do not have a Cloud Foundry account, sign up with this promo code: https://my.cloudfoundry.com/signup/preshavedyak If using your own laptop, make sure that you have Spring Tool Suite or Eclipse installed: http://www.springsource.org/sts (The instructions below are for STS)
  2. Install the Cloud Foundry plugin, Select Help > Dashboard, Click the Extensions tab, at the bottom left, type in “Cloud” in the Find field, then choose Cloud Foundry and click the Install button. Click on the prompted buttons until you are prompted to restart STS. Restart.
  3. Once you restart STS, in the Servers window where it says “No servers available. Define a new server from the …” click on the “new server wizard” link. (If you don’t see…

View original post 479 more words

Categories: Uncategorized

February 10, 2013 Leave a comment

Making the Complex Simple

In my last post we went over OAuth in general and we looked at how to use a Java library called Leeloo to authenticate with a service providing an OAuth 2 implementation.

Now that we are able to authenticate a service with OAuth, we need to be able to actually use that service to do something useful.

Many popular web service APIs like Facebook and Twitter provide a REST based implementation.

In this post I’ll show you how to easily connect to one of these web services from Android and parse any responses you get back.

AndroidREst

Should I use a REST library?

This is a valid question we should address before getting into the details.

My answer to this question is basically “no.”

I first tried the approach of using a REST library to make it easier to communicate to a REST based web service, but quickly found the overhead…

View original post 1,078 more words

Categories: Uncategorized

February 9, 2013 Leave a comment

Develop and Conquer

Spring 3.1 supports a new cache abstraction layer which allows you to implement caching in a web application beyond the L2 and query cache in Hibernate. This blog provides a quick walkthrough on how to setup and apply caching  in your codes using Spring and Ehcache.

Getting the jars

First, we need to add the spring context support and ehcache jar files to the project. I am using Maven and include the following dependencies in the pom file:

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>

<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.5.2</version>
</dependency>

Configure Spring

As with any other Spring components, we need to configure some beans in a XML file. At a minimum, we will need the followings:

<?xml version=”1.0″ encoding=”UTF-8″?>
<beans xmlns=”http://www.springframework.org/schema/beans”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xmlns:cache=”http://www.springframework.org/schema/cache”
xsi:schemaLocation=”
http://www.springframework.org/schema/beans    http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd”&gt;

<cache:annotation-driven cache-manager=”cacheManager”/>

<bean id=”cacheManager”>
<property name=”cacheManager” ref=”ehcache”/>
</bean>

<!– Ehcache library setup –>
<bean id=”ehcache”
class=”org.springframework.cache.ehcache.EhCacheManagerFactoryBean”>
<property name=”configLocation” value=”classpath:ehcache.xml”/>
</bean>

</beans>

Caching is setup…

View original post 351 more words

Categories: Uncategorized

February 6, 2013 Leave a comment

Shekhar Gulati

One of the features that you will not find in most Platform as a Service solutions is writing to file system. Writing to file system is very important as you need it in case you want to write user uploaded content to file system, or write lucene index or read some configuration file from a directory. OpenShift Express from the start support writing to file system.

In this blog I will create a simple Spring MVC MongoDB application which store movie documents. I will be using Spring Roo to quickly scaffold the application. Spring Roo does not provide file upload functionality so I will modify the default application to add that support. Then I will deploy the application to OpenShift Express.

Creating a OpenShift Express JBoss AS7 application

The first step is to create the JBoss AS7 applictaion in OpenShift Express. To do that type the command as shown below. I am…

View original post 238 more words

Categories: Uncategorized