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 7792685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:15:46+00:00 2026-06-01T22:15:46+00:00

I have a pretty basic tiles1 setup with header, menu, and content as so:

  • 0

I have a pretty basic tiles1 setup with header, menu, and content as so:

<definition name="Main" path="/WEB-INF/jsp/MainLayout.jsp">
    <put name="header" value="/WEB-INF/jsp/Header.jsp"/>
    <put name="menu" value="/WEB-INF/jsp/Menu.jsp"/>
    <put name="content" value=""/>
</definition>

All my subpages extend this definition and provide a jsp for the content section:

<definition name="SearchPage" extends="Main">
    <put name="content" value="/WEB-INF/jsp/Search.jsp"/>
</definition>

What I am looking for is a way for the SearchPage definition above to “put” an attribute so that it can be used in Search.jsp. My first attempt was:

<definition name="SearchPage" extends="Main">
    <put name="content" value="/WEB-INF/jsp/Search.jsp"/>
    <put name="showOptions" value="true" type="string"/>
</definition>

But in this case, the showOptions attribute would only be available to MainLayout.jsp and wouldn’t be passed down to Search.jsp. I know there’s some way to explicitly pass it down via useAttribute in the layout page, but I would very much like to avoid the layout page needing to know about every variable that I could possibly using in the subpages.

N.B. In tiles2 there seems to be a nifty cascade=”true” attribute that does exactly what I’m looking for but unfortunately I think I’m stuck with tiles1.


Nice one-line fix thanks to GriffeyDog:

In MainLayout.jsp import all the tiles attributes into the request scope. They are then available to all the subpages (watch out for name collisions).

<tiles:importAttribute scope="request"/>

I also found an alternate method which uses a definition with the necessary attributes as the content instead of a jsp page: http://wiki.apache.org/struts/StrutsDocTiles (solution #1)

  • 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-06-01T22:15:47+00:00Added an answer on June 1, 2026 at 10:15 pm

    You can use tiles:importAttribute and specify a scope, such as request. Do this in your main layout and then you should be able to access it in your search page.

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

Sidebar

Related Questions

I have a pretty basic assignment, but am having an issue making my main
I have a pretty basic NHibernate setup. I am not using Castle Widnsor or
I have a pretty basic 'featured-list - image slider' implemented above my content in
I might have pretty basic question about regex. I have the following regex, which
I have a pretty basic windows form app in .Net. All the code is
I have a pretty basic challenge-based iPhone game, and I wanted to know what
I have a pretty basic doubt on dirty read/writes to a value stored in
I have a pretty basic problem but I can't seem to figure it out...
I have created a pretty basic Flash website for a client and am having
I have a user control that is pretty basic. It contains several TextBox controls,

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.