Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7000269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:38:57+00:00 2026-05-27T20:38:57+00:00

Basically, what happens when I launch my project is that the views are all

  • 0

Basically, what happens when I launch my project is that the views are all resolved properly and the correct jsp is being looked for, however there seems to be something blocking tiles access to my jsp folder inside the WEB-INF folder.

The exact problem is that when I go to localhost/FitterBlog/index.htm I get a 404 error:

The requested resource (/FitterBlog/jsp/layout/layout.jsp) is not available.

I have the following code:

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>*.htm</url-pattern>
</servlet-mapping>
<session-config>
    <session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
    <welcome-file>redirect.jsp</welcome-file>
</welcome-file-list>
</web-app>

dispatcher-servlet.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:p="http://www.springframework.org/schema/p"
   xmlns:aop="http://www.springframework.org/schema/aop"
   xmlns:tx="http://www.springframework.org/schema/tx"
   xmlns:context="http://www.springframework.org/schema/context"

   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
   http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
   http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
   http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<context:component-scan base-package="com.fitterblog.controllers"/>
<context:annotation-config/>

<!-- tiles configuration -->
<bean id="tilesViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    <property name="viewClass">
        <value>org.springframework.web.servlet.view.tiles2.TilesView</value>
    </property>
</bean>

<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
    <property name="definitions">
        <list>
            <value>/WEB-INF/tiles.xml</value>
        </list>
    </property>
</bean>

</beans>

tiles.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
   "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
   "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">

<tiles-definitions>
<definition name="baseLayout" template="/jsp/layout/layout.jsp">
    <put-attribute name="title" value="FitterBlog" />
    <put-attribute name="header" value="/jsp/layout/header.jsp" />
    <put-attribute name="nav" value="/jsp/layout/nav.jsp" />
    <put-attribute name="body" value="" />
    <put-attribute name="footer" value="/jsp/layout/footer.jsp" />
</definition>

<definition name="index" extends="baseLayout">
    <put-attribute name="body" value="/jsp/index.jsp" />
</definition>   
</tiles-definitions>

MainController.java:

package com.fitterblog.controllers;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class MainController {

@RequestMapping(value="index.htm", method=RequestMethod.GET)
public ModelAndView index() {
    return new ModelAndView("index");
}
}

I have triple checked that all the JSP files are located in the correct location, as in the layout.jsp file that gets the 404 error is located in WEB-INF/jsp/layout/layout.jsp.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:38:57+00:00Added an answer on May 27, 2026 at 8:38 pm

    In my application the jsp’s are located in subdirectories of WEB-INF.

    If it is the same for you you need to change the tiles config a bit

    <tiles-definitions>
    <definition name="baseLayout" template="/WEB-INF/jsp/layout/layout.jsp">
        <put-attribute name="title" value="FitterBlog" />
        <put-attribute name="header" value="/WEB-INF/jsp/layout/header.jsp" />
        <put-attribute name="nav" value="/WEB-INF/jsp/layout/nav.jsp" />
        <put-attribute name="body" value="" />
        <put-attribute name="footer" value="/WEB-INF/jsp/layout/footer.jsp" />
    </definition>
    
    <definition name="index" extends="baseLayout">
        <put-attribute name="body" value="/WEB-INF/jsp/index.jsp" />
    </definition>   
    </tiles-definitions>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, basically, I have an element that I get which happens to be a
basically the problem is, that the only way to get all instances of VLC
I am not sure whether this only happens to me. Basically if I have
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse
Basically I’ve heard that certain conditions will cause .NET to blow past the finally
Basically I'm trying to accomplish the same thing that mailto:bgates@microsoft.com does in Internet Explorer
Is there a way to embed a website (that I have no control what-so-ever
basically I'm building a custom scroll bar that has a table layout inside it.
I have basically finished developing an android app that makes use of SQLite databases
This is basically what happens: > git rebase -i HEAD~3 Successfully rebased and updated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.