Archive for the ‘Spring’ Category
It’s frustrating to find all your settings gone when you upgrade eclipse versions and if you’re pedantic about certain settings (like I am) it can take you almost an entire day to upgrade versions (with everything working just the way you like it). With Indigo, fortunately, none of the manual settings were necessary. There was [...]
I’m a fan of the spring framework and I have recently become a fan of DWR as well. Both of them together are just unstoppable, they take ajax and bean exposure through javascript to a new level. I have written about my experiences integrating the two and about validating forms using ajax. I’d advise you [...]
We always want to know who is on our website, how many users are logged in and how many visitors are present. Not only is the information useful, it also looks good.
I tried looking for pluggable solutions to track users but couldn’t find any. Having implemented spring security in a few web apps, I decided to see if there was an easy way to do this.
Once in a while this kind of a question pops up on the spring forums. The requirement is almost always the same : Map many URLs to a single controller and/or map all URL’s without a defacto mapping to a default controller. Both have different solutions. Let’s discuss the first one. The @RequestMapping annotation makes [...]
Question like this one popup on the spring security forum all the time. The question is almost always the same. The system must perform some custom action after a user logs in or out of the system. And almost always this action has to be performed on the session like setting an attribute or removing [...]
More often than not people come to the spring forums asking about PropertyEditor’s. PropertyEditors are needed when you want to convert a string value to an object. Say for example, your command object contains a reference to a User object and the list of user’s is shown in the jsp with the value of the [...]
I hate writing pagination code. Infact I hate it so much, I try not to paginate my lists at all. ( I know, i know, very bad on my part) . Writing pagination code totally destroys the code reuse in an application, developers generally just copy paste the very same pagination code all over the [...]
It’s all to common for beginners of spring to stumble upon what may look like odd spring problems. Most users think that these are bugs while more often than not they are expected spring behaviour. I myself have stumbled upon my fair share of such problems. One such problem is clearing the data contained within [...]
I wish spring security would work on their documentation and tell people how easy it is to implement a custom service for loading user details. You don’t HAVE to use JDBC to do that, you can write your very own hibernate, toplink or whatever DAO to do just that. It’s important to realise that spring-security [...]
Form validation is an integral part of any web application. While most developers rely on client side validations, the good ones always perform server side validations as well before accepting any data. You never know what kind of a malicious attack/vulnerability might be exposed if you don’t validate all data. Submitting, validating and then returning [...]
In my earlier article I had detailed how to get DWR working with spring. Once you get that done, how exactly do you use it? Even though DWR provides a very powerful debugging page, a real-world example never hurts. I’ll construct a simple page which will present the user with a list of countries (populated [...]
So I managed to configure spring security in my last article here but what do I do now. How do I create the login form, login.jsp for my users to authenticate from. I searched around and found a few articles but none that listed out the login page. Then I looked in the spring-security distribution
I have written another post listing how to construct your login and logout pages to work with spring-security. It’s important that you read this post first if you’re new to spring-security. Security in web applications is a big concern. More often than not developers miss securing a few pages here and there. These pages aren’t [...]
I like DWR, it’s a very strong framework for enriching your simple web application with ajax. It’s particularly useful for java developers because no one likes to write javascript to make XMLHttpRequest’s to call the server, parse the response and then set stuff in your jsp so that the response is displayed in a proper [...]
A question commonly asked on the spring forums is that a service makes calls to multiple DAOs, how can ALL the calls be rolledback if any of the calls throws an exception. The simplest way to do this is to make your service transactional while keeping your DAOs non-transactional. Example Service : Notice the lack [...]
