Category: JSP

Force IE out of compatibility mode

Force IE out of compatibility mode

Add this to within the <head> <meta http-equiv=”X-UA-Compatible” content=”IE=edge” /> This forces IE out of compatibility mode. IE will ignore compatibility mode settings from the ‘(F12) Developer Tools’ facility. Here’s some code that will allow testing. Done using ‘IE Tester’ http://www.my-debugbar.com/wiki/IETester/HomePage IE7 and IE8 will render this differently. IE8 in compatibility […]

Hello Spring 3 Security with Netbeans – Role Based Method Protection

Hello Spring 3 Security with Netbeans – Role Based Method Protection

This tutorial will outline in simple steps how to do the following: Create Spring 3 Web MVC project using Netbeans Introduce Spring Security measures Limit @Controller method invocation to certain User-Role’s using Annotations Roles and users are defined within XML configurations. The full source code is available for download here

Custom Annotated Validation with Spring 3 Web MVC

Custom Annotated Validation with Spring 3 Web MVC

My previous tutorial detailed using Hibernate Validation within Spring 3 Web MVC.  This tutorial shows how to create custom validation annotations. E.g.

This example annotation only permits the word ‘John’. Optionally, it can be case-sensitive. 

Integrating Hibernate with Spring 3 Web MVC

Integrating Hibernate with Spring 3 Web MVC

This tutorial on “Integrating Hibernate with Spring 3 Web MVC” incorporates: Hibernate Transaction Control @RequestMapping friendly URL’s. More on this specific Spring 3 Web MVC friendly URL topic here. (Alternative @RequestParam method here) A Generic DAO suitable for Hibernate operations with Spring 3 Web MVC. More here in this separate […]

Setting the Welcome Page in Spring Web MVC

Setting the Welcome Page in Spring Web MVC

In any Spring Web MVC application, there is a need to set the default landing or welcome page. Traditionally in Java web applications, this is done in the web.xml file as so:

Or in a spring web mvc application, it might be like this:

With a corresponding controller class RequestMapping: […]

A Generic DAO for Hibernate

A Generic DAO for Hibernate

This short blog shares one Generic DAO (Data Access Object) for Hibernate that may be useful in a Spring 3 project. The source code is available for download at the bottom of this page.

Determining the primary key value of an entity bean using reflection

Determining the primary key value of an entity bean using reflection

Given some Entity Object or generic type T, it may be useful to determine the value of the primary key without knowing the object type.

Determining the primary key property name of an entity bean using reflection

Determining the primary key property name of an entity bean using reflection

The name of the property that represents the primary key of an Entity Bean can be determined using reflection as follows: To get the actual value see this tutorial

Using @RequestParam to pass in HTTP GET parameters in Spring 3 Web MVC

Using @RequestParam to pass in HTTP GET parameters in Spring 3 Web MVC

Receiving HTTP GET parameters in Spring is made very easy using the @RequestParam annotation.

Creating a Java Web Application Filter

Creating a Java Web Application Filter

Just a simple note to demonstrate this. Create a source file that implements

This interface provides three methods: