Spring web app tutorial extras: apache tiles causes server error

Some people reported that in step 4 of Spring web application tutorial they weren’t able to integrate tiles, because of this error: Server error, caused by javax.servlet.ServletException: Could not resolve view with name 'index' in servlet with name 'dispatcher'.

Some people reported that in step 4 of Spring web application tutorial they weren’t able to integrate tiles, because of this error: Server error, caused by javax.servlet.ServletException: Could not resolve view with name 'index' in servlet with name 'dispatcher' The problem is a combination of apache tiles, jetty server and a path, which contains a whitespace.

There are three solutions:

  1. Move the project somewhere else, so that in path is no whitespace. This is the simplest solution of this problem.
  2. Upgrade tiles-request-api to at least 1.0.6
  3. Use Tomcat.

To upgrade tiles-request-api add this to dependencies:

<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-request-api</artifactId>
<version>1.0.6</version>
</dependency>

To use Tomcat you need to add this dependency:

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>

Next add this plugin:

<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>

And run the application using

tomcat7:run

Now your application will run on this URL: http://localhost:8080/java-blog-aggregator