Home » Tag Archives: Spring (page 26)

Tag Archives: Spring

Spring MVC: Session advanced

spring-interview-questions-answers

Not so long time ago I wrote a post about HTTP sessions in a Spring MVC application. That was the simple article with an emphasis on practical aspect of usage. In the end of the post I promised to write more advanced topic dedicated to the sessions in Spring MVC applications. So I’m going to publish this stuff. Before I ...

Read More »

Spring MVC Custom Validation Annotations

spring-interview-questions-answers

Last tutorial, I showed how to validate a form using annotations. This works great for simple validations, but eventually, you’ll need to validate some custom rules that aren’t available in the out-of-the-box annotations. For example, what if you need to validate that a user is over 21 years old, calculated based off their input birthdate, or, maybe you need to ...

Read More »

Auditing a Spring MVC Webapp with AspectJ. Part 2

spring-interview-questions-answers

Now, this is the blog you want to read if you’re interested in creating a Spring MVC Webapp that uses Aspect Oriented Programming (AOP) in the form of Aspectj’s @Aspect and @Before annotations to audit a user’s visit to a screen. As I said in my last blog auditing a user’s visits to a screen is one of those few ...

Read More »

su and sudo in Spring Security applications

spring-interview-questions-answers

Long time ago I worked on a project that had a quite powerful feature. There were two roles: user and supervisor. Supervisor could change any document in the system in any way while users were much more limited to workflow constraints. When a normal user had some issue with the document currently being edited and stored in HTTP session, supervisor ...

Read More »

Unit Testing of Spring MVC Controllers: Configuration

spring-interview-questions-answers

Writing unit tests for Spring MVC controllers has traditionally been both simple and problematic. Although it is pretty simple to write unit tests which invoke controller methods, the problem is that those unit tests are not comprehensive enough. For example, we cannot test controller mappings, validation and exception handling just by invoking the tested controller method. Spring MVC Test solved ...

Read More »

Auditing a Spring MVC Webapp with AspectJ. Part 1

aspectj-logo

If you’re like me, then you’ll have those kinds of programming days where everything seems to go incredibly well. You write the code and the tests and it just works. And then and there are those other kinds of days, the really bad ones, where you know that everything you’ve written is as right as it can be and the ...

Read More »

Spring from the Trenches: Using Environment Specific Cron Expressions with the @Scheduled Annotation

spring-interview-questions-answers

The @Scheduled annotation offers an easy way to create scheduled tasks in Spring powered applications. We can use it to schedule our tasks by using either periodic scheduling or cron expressions. Although period scheduling can also be useful, the cron expressions give us much more control over the invocation of the scheduled tasks. That is why they are very useful ...

Read More »

Spring JTA multiple resource transactions in Tomcat with Atomikos example

atomikos-logo

In this tutorial we shall show you how to implement JTA multiple resource transactions in a Tomcat server, using Atomikos Transaction Manager. Atomicos transaction manager provides support for distributed transactions. These are multi-phased transactions, often using multiple databases, that must be committed in a coordinated way. The distributed transactions are described by the XA standard. XA governs how a transaction ...

Read More »

Spring MVC Error handling flow

spring-interview-questions-answers

There are broadly three ways of handling an exception flow using Spring MVC, the objective being to intercept any application exception and present a friendly and informative view back to the user. 1. Using error-page tag in web.xml file: This is a servlet specs driven approach, where the exceptions that bubble up from the application are intercepted based on either ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close