Himu\’s Attempt at Blogging

Tidbits from my thoughts

Posts Tagged ‘Java

Multiple Choices in Spring Injection – @Resource, @Autowired and @Inject

leave a comment »

I just came up with this wonderful blog post by David Kessler. Kudos David!

Spring Injection with @Resource, @Autowired and @Inject.


Written by mhimu

April 5, 2012 at 1:35 pm

Posted in Java, spring

Tagged with , , ,

Spring MVC Tutorial – Using Tiles 2

with 7 comments

This post is also based on my previous work:

  1. Spring MVC Tutorial – Hibernate Integration – build a Spring MVC app using Hibernate from the ground up.
  2. Spring MVC Tutorial – Paging through Hibernate and Selection Handling – add table/list browsing support utilizing paging in Hibernate, add a page navigation bar, add checkbox handling against table rows.

Here I will not add any new functionality – just move the view technology to Tiles 2 that comes bundled with Spring complete distribution.

The new completed project is available as ibank-v3.zip.

Till now, I have repeated header/footer/menu code in all the JSP files. Tiles 2 can be used to remove that repetition. Let’s begin.

Read the rest of this entry »

Written by mhimu

December 9, 2009 at 2:53 pm

Posted in Java, spring

Tagged with , , ,

Spring MVC Tutorial – Paging Through Hibernate and Selection Handling

with 14 comments

In this installment, I’m expanding the project done in Spring MVC Tutorial – Hibernate Integration to include:

  1. Browsing/paging through a table with a navigation bar found in various forum sites and ASP.NET GridView (e.g. First 3 4 5 6 7 Last)
  2. Showing checkboxes against each row of the table for selective action

The related project code download is ibank-v2.zip

Read the rest of this entry »

Written by mhimu

November 26, 2009 at 3:31 pm

Spring MVC Tutorial – Hibernate Integration

with 43 comments

After a long gap…

For introduction to Spring MVC in particular, see Spring MVC Tutorial and Spring MVC Tutorial 2.

The project done in STS can be downloaded from my Box.net account. The project libraries you will have to edit to match your setup.

Along with learning to integrate Hibernate, I’ll be introducing some new pieces of Spring MVC.
Read the rest of this entry »

Written by mhimu

November 16, 2009 at 2:44 pm

Posted in Java, spring

Tagged with , , ,

Java Date is so stupid

with 2 comments

Everytime I try to work with java.util.Date, I get frustrated. Why is the API so cumbersome?

Have you ever tried to find the difference between to Date values? There is nothing except a millisecond value. I don’t want milliseconds! I want rounded days and the timestamp comes to taunt me!

Why can’t you simply add to or subtract from a Date? I don’t want to handle multiple Calendar objects when working with multiple Date values simultaneously. It just bloats the code!

I cannot instantiate a specific Date if I want to. Go through Calendar again? But why??

Maybe you will tell me about various design issues. But I don’t want to bother. I just want a simple interface for manipulating Date values.

Written by mhimu

December 19, 2007 at 1:59 pm

Posted in Java

Tagged with ,

Spring MVC Tutorial, 2

with 16 comments

This is my second installment of the tutorial. For the first part, see Spring MVC Tutorial.

6 Adding Localization Support

These days, there is much touting about i18n (internalization) and l10n (localization). So, I guess I need to support them also. In fact, I’ve already done the ground work for localizing error messages (error.invalid.principal in LoanCalcValidator, <form:errors> in loanCalc.jsp).

The first thing I’ll do now is add a resource bundle in springweb-servlet.xml for localized messages:

Read the rest of this entry »

Written by mhimu

December 10, 2007 at 3:07 pm

Posted in spring

Tagged with , ,

Spring MVC Tutorial

with 164 comments

Hello everybody! A few days ago, I googled ‘Spring MVC Tutorial’ and didn’t find that many references. So I thought if I could write a good tutorial on Spring MVC then that might help lots of people. I don’t know if I’ll be successful but here it is.

This tutorial covers only the basics involving AbstractController and SimpleFormController. I intend to cover AbstractWizardFormController, Hibernate/JPA integration, Tiles, Sitemesh, Ajax, etc. as I learn them and find time to write.

Comments welcome!
Read the rest of this entry »

Written by mhimu

November 27, 2007 at 1:03 pm

Posted in spring

Tagged with , ,