Book | JIRA | Confluence | Forum

20061221 Thursday December 21, 2006

Dependency Injection Demystified Category: Spring Live

James Shore has a short-n-sweet definition of dependency injection.

Dependency injection means giving an object its instance variables. Really. That's it.

If you're not using dependency injection in your projects, it's a good read. As far as using a framework like Spring, that's secondary to the whole concept of DI. (2006-12-21 13:10:02.0) Permalink Comments [2]


I have a query. User enters & submits some data by clicking submit button. On successful storage or processing of data I have to show him on alert window "DONE SUCCESSFULLY" on the same page in which he has entered the data. How this can be done. Can u help me please...

Posted by Srinivas on December 29, 2006 at 12:59 AM EST #

Here's an example from Spring Live. The same file that's used to upload a file is routed back to after the file is uploaded.

<c:if test="${not empty model.filename}">
<p style="font-weight: bold">
Uploaded file (click to view): <a href="${model.url}">${model.filename}</a>

To change this to an alert, you could do:

<c:if test="${not empty model.filename}">
<script style="text/javascript">
alert("${model.filename} was uploaded successfully. Click OK to continue");

Personally, I think alerts are annoying. The first is more user-friendly IMO.

Posted by Matt Raible ( on December 29, 2006 at 11:53 PM EST #

Post a Comment:


Your Comment:

HTML Syntax: On

Please answer this simple math question

0 + 52 =

Weblog Archives
Click this photograph for National Geographic's Photo of the Day
Photo of the Day
Spring Logo
+ SourceBeat Weblogs

+ Spring Framework

Spring Live Book
• Raible Designs
• Who is Matt Raible?