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

  • Home
  • SEARCH
  • 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 595103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:01:33+00:00 2026-05-13T16:01:33+00:00

I am using Apache Tiles 2.1.4 with Spring MVC 3. I have managed to

  • 0

I am using Apache Tiles 2.1.4 with Spring MVC 3. I have managed to configure these together and everything works fine. My next step is to add CSS and this is where I am having an issue – this is most probably a simple one but I can’t get my template jsp to pick up the css.

Snippet from my tiles-defs.xml

<definition name="baseLayout" template="/WEB-INF/tiles/baseLayout.jsp">
  <put-attribute name="title"  value="Template"/>
  <put-attribute name="header" value="/WEB-INF/tiles/header.jsp"/>
  <put-attribute name="styles" value="base.css"/>
  <put-attribute name="subheader"   value="/WEB-INF/tiles/subheader.jsp"/>
  <put-attribute name="menu"   value="/WEB-INF/tiles/menu.jsp"/>
  <put-list-attribute name="bodyItems">
      <add-attribute value="/WEB-INF/tiles/body.jsp"/>
  </put-list-attribute>

Snippet from my template jsp (baseLayout.jsp)

<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/WEB-INF/css/displayTagTable.css"/>

Snippet from my css:

body {
background-color: red;

}

I have kept the css as simple as possible just to check if my jsp picks up the css file.

I have also checked that my css file is in the correct location – but my jsp file is not picking up the css file. Can someone help?

Any help will be much appreciated.

Thanks,
Zahanghir

  • 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-13T16:01:33+00:00Added an answer on May 13, 2026 at 4:01 pm

    Files within WEB-INF aren’t served directly through public URLs. Spring and tiles are able to indirectly serve JSPs files from WEB-INF programatically.

    Can you please try moving the css directory into WebContent and updating your <link> tag’s href attribute?

    After you get that working, I have a suggestion. You can use Tiles tags if you include this page directive at the tops of your JSPs:

    <%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
    

    If you want, this allows you to store your CSS path as an attribute in tiles-defs.xml, and retrieve it from your JSPs with the tag:

    <link type="text/css" rel="stylesheet"
        href="<tiles:getAsString name="IDENTIFIER_HERE"/>"/>
    

    Your CSS URL will replace the tiles tag. And you could use this CSS path across multiple Tiles definitions.

    The rest of the Tiles tags are documented here: Tiles Tag Reference Sheet

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using apache ant to generate javadoc for my project. I have a
I have a web site using apache httpd as the server and mysql as
We have a Spring application that uses Apache DBCP for connection pooling. Our app
I have a Pylons app that I'm trying to set up using Apache and
I am using Apache Poi and Java for Excel manipulation. I have modified some
Using Apache's commons-httpclient for Java, what's the best way to add query parameters to
I am using Apache Axis to connect my Java app to a web server.
I am using Apache HttpClient and would like to communicate HTTP errors (400 Bad
I'm using Apache Subversion to manage and store a decent volume of code. Trying
I am using Apache Felix and its Declarative Services (SCR) to wire the service

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.