Home » Tag Archives: Spring MVC (page 3)

Tag Archives: Spring MVC

Understanding Spring Web Initialization

spring-interview-questions-answers

Few years ago majority of us were used to write XML config files everywhere, to setup even simple Java EE application. Today using Java or Groovy to configure projects is becoming preferred way – you just need to take a look at Gradle or functionalities introduced in further versions of the Spring Framework to gen up on this. Now I’ll ...

Read More »

Adding Social Sign In to a Spring MVC Web Application: Unit Testing

spring-interview-questions-answers

Spring Social 1.0 has a spring-social-test module which provides support for testing Connect implementations and API bindings. This module was removed from Spring Social 1.1.0, and it was replaced with the Spring MVC Test framework. The problem is that there is practically no information about writing unit tests for an application which uses Spring Social 1.1.0. This blog post fixes ...

Read More »

Using more than one property file in Spring MVC

spring-interview-questions-answers

Everybody heard about portals which combine single web applications to a big one. A portal software works like mashups – content from several sources is picked up in a single service, mostly displayed in a single web page. A portal software also allows to change user settings, such as language or theme, across all single web applications (independent modules) embedded ...

Read More »

HOW-TO: Custom error pages in Tomcat with Spring MVC

apache-tomcat-logo

Default Tomcat error pages look scary. In addition, they may expose valuable information including server version and exception stack trace. Servlet specification provides a way to configure an exceptional behavior through web.xml. One can configure either reaction on a specific Java exception or to a selected Http response code(s). error-page element specifies a mapping between an error code or exception ...

Read More »

Getting started with annotation based Spring MVC web application

spring-interview-questions-answers

Here is a minimal way to get a Spring 3 MVC project started with Maven. First create spring-web-annotation/pom.xml file and include the Spring dependency:               <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>spring-web-annotation</groupId> <artifactId>spring-web-annotation</artifactId> <version>1.0-SNAPSHOT</version> <packaging>war</packaging> <dependencies> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>3.2.4.RELEASE</version> </dependency> </dependencies> </project> Now ...

Read More »

Spring MVC: Ajax & JQuery

spring-interview-questions-answers

Today I want to demonstrate how to integrate AJAX into a Spring MVC application. I’m going to use JQuery on a client side for sending of requests and receiving of responses. This tutorial will be based on one of my previous tutorials about Spring MVC and REST services. In this article you will read how to make a web-application more ...

Read More »

Spring MVC: Resources

spring-interview-questions-answers

One of the most frequent questions which I receive from my blog readers is how to use css and javascript files in application with Spring MVC. So it’s a good opportunity to write an article about usage of resources in Spring MVC. As usually I will use java based configuration approach. In a nowadays it’s hard to imagine web-application which ...

Read More »

Unit Testing of Spring MVC Controllers: REST API

spring-interview-questions-answers

Spring MVC provides an easy way to create REST APIs. However, writing comprehensive and fast unit tests for these APIs has been troublesome. The release of the Spring MVC Test framework gave us the possibility to write unit tests which are readable, comprehensive and fast. This blog post describes how we can write unit tests for a REST API by ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.