I couldn’t compile Spring Security Sample Tutorial Application, so I decided to change the build system from Gradle to Maven to see it in action.
Spring Roo 1.2.0 has just been released, so I used it to create the project structure fastly. Here are the commands typed in the shell:
mkdir security-tutorial cd security-tutorial roo . . . → Read More: Mavenizing Spring Security Tutorial
Continuing with the previous example, let’s add security to the application. In the Roo Shell, I type:
Files created or updated:
Created META-INF/spring/applicationContext-security.xml Created views/login.jspx Updated WEB-INF/views/views.xml Updated pom.xml Updated WEB-INF/web.xml Updated WEB-INF/spring/webmvc-config.xml
New dependencies added:
spring-security-core 3.0.5.RELEASE spring-security-config 3.0.5.RELEASE spring-security-web 3.0.5.RELEASE spring-security-taglibs 3.0.5.RELEASE
In pom.xml I change the property spring-security.version to 3.1.0.RELEASE.
. . . → Read More: Adding Spring Security with Roo 1.1.5
Roo is Heaven and Hell.
Heaven is in the demos. It looks great, you can do a basic web application with Java in minutes!
Hell, when confronted with real world problems, and with bugs, but hey, I’ve not given up on it yet, it’s great to set up the basic project structure, and . . . → Read More: Examining what Spring Roo 1.1.5 creates
Google App Engine has a way to dump and restore data, using the bulkloader.py command from Python SDK.
To be able to use it with a Java application, first we’ve to map the RemoteApiServlet in web.xml
<servlet> <servlet-name>RemoteApi</servlet-name> <servlet-class>com.google.apphosting.utils.remoteapi.RemoteApiServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>RemoteApi</servlet-name> <url-pattern>/remote_api</url-pattern> </servlet-mapping>
Here is the command to dump all the instances of . . . → Read More: Dumping and Restoring Data with Google App Engine
Google App Engine allows 200 datastore indexes, so once in a while is a good idea to clean up unused indexes. This operation is called vacuum-indexes, and is available in the Python and Java SDK.
I’ve done the index cleaning in my Java application using the Python SDK, because historically this operation was possible only . . . → Read More: Cleaning up unused indexes in Google App Engine
Since I’ve already wrote about PostgreSQL and H2 Hibernate configuration, I thought it’s a good idea to add MySQL too for my reference.
First I’ve added the dependency to Maven’s pom.xml (see the Maven repository for the latest version).
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.18</version> </dependency>
The second step is Hibernate configuration, here is an example:
. . . → Read More: Hibernate and MySQL
H2 is a small embeddable Java Database that supports a in memory mode (it also has a server mode). It’s a great choice for testing, since it doesn’t require any DB set up.
To try it out, the first step is adding the dependency to Maven’s pom.xml (see the Maven Repository for the latest version).
. . . → Read More: Hibernate and H2
I’m finally fluent in Spring and Spring-MVC and I am studying Hibernate. If I think about DBMS that I’ve been using, I can recall SQL Server, Oracle and a lot of MySQL. As for PostgreSQL, I kept on hearing good news about how robust and standard based it is, but I’ve never had a chance . . . → Read More: Hibernate and PostgreSQL
I’m using the Spring Framework, I understood on my skin the importance of testing everything and to allow that dependency injection is important because allows to test every class independently from others. Further Spring favors programming to interfaces rather than concrete implementations.
To that respect I find a good idea to name the implementation with . . . → Read More: Eclipse: open implementation
Pre-requisites: Eclipse, WTP, m2eclipse, maven
First create the new project as File > New > Maven Project > Next Uncheck “Use default Workspace location” and define a folder to host your project. Type maven-archetype-webapp and click Next. Choose Group Id, Artifact Id, Version and Package and press Finish.
At this point the project is created, . . . → Read More: Creating a new Web Application with Eclipse and Maven