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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:15:03+00:00 2026-06-18T07:15:03+00:00

I’m trying to modify how my pages look like, based on which module is

  • 0

I’m trying to modify how my pages look like, based on which module is currently active. So basically, I have one common set of jsp pages, that need to have tiles changed based on the module.

I am able to implement basic tiles independently with each module. This requires me to specify in the jsp the definition of the tile. So my question is, how can I change the definiton, and hence, have the tiles change dynamically based on the module.

I’m using Tiles with Struts 1.1 (Not my choice, but the requirements were such), and am new to this framework.

Edit: I’ve tried going through the docs, browsing other forums and blogs, but havent encountered anything similar to this. Is there any other way to achieve this, probably without switching the tile definitions?

  • 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-18T07:15:05+00:00Added an answer on June 18, 2026 at 7:15 am

    What I understood from your question is you will be having 2 definition for 1 JSP in tiles-defs.xml file. Like

    <definition name="outputPage" extends="mainLayout">
        <put name="title" value="HELLO" />
        <put name="body"   value="/pages/Welcome.jsp" />
    </definition>
    <definition name="outputPage2" extends="mainLayout">
        <put name="title" value="HELLO2" />
        <put name="body"   value="/pages/tile2.jsp" />
    </definition>
    

    One way I suggest to achieve your requirement is by setting module type in attribute (say request.setAttribute("module", "module2");).

    Suppose you will be having 2 forwards for same JSP page in struts-config.xml.

        <action
                path="/Welcome"
                forward="/pages/tileTest.jsp"/>  
    <action
                path="/customerAction"
                type="xyz.actions.CustomerAction"
                name="customerForm"
                scope="request">
    
                <forward name="tile" path="/Welcome.do"></forward>
                <forward name="customer" path="/pages/customer.jsp"></forward>
           </action>
    

    Then in your JSP page(tileTest.jsp), the tiles will be defined something like

        <%@page language="java" pageEncoding="shift-jis"%>
    <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
    <%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
    <logic:notEmpty name="module">
    <logic:equal name="module" value="module1">
    <tiles:insert definition="outputPage" flush="true" />
    </logic:equal>
    </logic:notEmpty>
    
    <logic:notEmpty name="module">
    <logic:equal name="module" value="module2">
    <tiles:insert definition="outputPage2" flush="true" />
    </logic:equal>
    </logic:notEmpty>
    
    <logic:empty name="module">
    <tiles:insert definition="outputPage" flush="true" />
    </logic:empty>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a small JavaScript validation script that validates inputs based on Regex. I
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I have an autohotkey script which looks up a word in a bilingual dictionary
I'm trying to select an H1 element which is the second-child in its group
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from

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.