Using Enum Types In Struts 2

Introduction

It is sometimes useful to use an enum type as a field in a model class or as a field in a Struts 2 ActionSupport class. This article discusses how to use enumerations with the Struts 2 framework and provides a complete example application to demonstrate the use of enumerations in a Struts 2 application.

[More]

Blackboard Learn 9.1 Web Services Tutorials and Documentation

Blackboard Learn provides extensive web services that external applications may use to get information from and add information to Blackboard. The below links can be used to learn about Blackboard Learn 9.1 web services and to download Java applications that demonstrate how to use the web services.

I wrote these Java example applications, tutorials and documentation based on updated versions of my previous blog articles on Blackboard Learn's web services. Each file includes a link to download an example Java application that can be viewed in any Maven compatible Java IDE. The example applications include a detailed ReadMe.txt file that explains how to build and run the example either in Eclipse or just using Maven.

[More]

Using Spring Data JPA To Reduce Data Access Coding

Introduction

On March 24, 2011, springsource released milestone 2 of the Spring Data JPA library. Per the Spring Data project website, Spring Data JPA:

Simplifies the development of creating a JPA-based data access layer and provides 'cross-store' persistence functionality for JPA managed entites [sic].

Since I recently started using JPA 2 in my Spring applications, I decided to learn more about Spring Data JPA. To assist my learning, I took an example project that uses Struts 2, Spring 3, JPA 2 (with Hibernate 3.5 as the JPA provider) and modified it to use Spring Data JPA. This blog article is about what I had to modify so the project could use Spring Data JPA and what I could then get rid of.

[More]

Spring 3.1 Cache Implementation With Cacheable and CacheEvict Annotations

Introduction

One of the new features in Spring 3.1 is cache abstraction that allows developers to easily cache method results. This blog article provides a simple Maven Java project that demonstrates how to use the new cache annotations.

[More]

Contexts and Dependency Injection With Maven and Tomcat 7

Introduction

As I worked my way through the Contexts and Dependency Injection (CDI) part of the Java EE 6 tutorial I wanted to learn how to use CDI with Tomcat 7 and Maven. The examples that come with the Java EE 6 tutorial provided by Oracle are NetBeans projects and use the GlassFish 3 server (which has built in support for CDI). Since my development environment is Maven and Tomcat, I wanted to translate the CDI examples in the Java EE 6 tutorial to my environment. Just like with my work on converting the JSF 2 example to Maven and Tomcat, converting the CDI example meant a ride on the JSF 2 - Tomcat 7 pain train.

[More]

JSF 2, Maven, and Tomcat 7

Introduction

As I worked my way through the Java EE 6 tutorial I needed to learn how to use JSF 2 with Tomcat 7 and Maven. The examples that come with the Java EE 6 tutorial provided by Oracle are NetBeans projects and use the GlassFish 3 server (which has built in support for JSF 2). Since my development environment is Maven and Tomcat, I wanted to translate the JSF 2 examples in the Java EE 6 tutorial to my environment. This work went pretty smoothly except for one big GOTHCA caused by a little advertised bug in the latest version of Oracle's reference implementation of JSF 2.

[More]

Struts 2 Security Vulnerability - Dynamic Method Invocation

Introduction

The Struts 2 web application framework has a long-standing security vulnerability that may not be well known to new Struts 2 developers. By default the framework enables a technique called dynamic method invocation. This technique allows a developer to specify in a Struts 2 action url what method should be called in the Action class. The security problem is that any user of the Struts 2 web application can also use dynamic method invocation to call a public method that is in the Action class. The purpose of this article is to explain the vulnerability and how to fix it. Note this problem occurs through the Struts 2.2.1.1 release, which is the latest release as of February 2011.

[More]

Maven, Servlet 3.0, and Tomcat 7

Introduction

With the release of Tomcat 7, Java web application developers have an alternative to GlassFish 3 for testing and running web applications that use the new Servlet 3.0 specification that is part of Jave EE 6. Oracle provides a good online tutorial for learning about Java EE 6 and Servlet 3.0. However, the tutorial's example applications are geared toward either using NetBeans or Ant and the GlassFish 3 server. Since I use Maven and Tomcat, I wanted to try out the Servlet 3.0 example application in Tomcat 7. This article provides a Maven version of the mood example application that is part of the Servlet 3 tutorial. The "mavenized" version of the tutorial's mood project can be easily packaged and deployed to the Tomcat 7 Servlet/JSP container.

[More]

Tutorials On Shiro-A Java Security Framework-Updated

I updated the tutorials I wrote about Shiro (http://shiro.apache.org, formerly known as JSecurity and Ki) to use the latest version of the library. Shiro is a "Java security framework that performs authentication, authorization, cryptography, and session management". Shiro became a Top Level Apache project in September 2010 and version 1.1.0 of the library was released in November 2010.

In 2009, when I wrote the tutorials, Shiro was known as JSecurity and was on version 0.9. With the move to the new name and to Apache, the package structure of the library changed. I wanted to update my tutorials so that users trying to learn Shiro would have a better reference.

Shiro is licensed under the Apache Software License, Version 2.0

You can view the tutorials on Shiro (version 1.1.0) starting here.

Recommended Way To Structure A Spring 3, JPA 2, and Maven Web Application

Introduction

I've created an example application that uses Struts 2, Spring 3, JPA 2, Hibernate 3.5, and Maven. I need some advice from Java web application developers who are using Spring 3, JPA 2, and Maven. The programming team I'm part of is moving to JPA. We plan to use Hibernate as the JPA provider but we want to keep the dependency on Hibernate to a minimum. To reduce our direct dependency on Hibernate we are using the Spring - JPA configuration described in chapter 4 of Spring Persistence with Hibernate and in section 13.5 of the Spring 3 documentation (see references below). I've run into an issue with configuring my applications to follow this structure and I'd appreciate any advice from Java developers more experienced with Spring, JPA, and Maven.

[More]

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9.1.002. Contact Blog Owner