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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:17:54+00:00 2026-05-11T19:17:54+00:00

I am using struts 1.1 with tiles. I have tiles with definitions like <definition

  • 0

I am using struts 1.1 with tiles.

I have tiles with definitions like

<definition name="cnmp.body.index" extends="cnmp.mainLayout" >
  <put name="title"  value="CNM Portal" />
  <put name="bodytitle"  value="Home" />
  <put name="body"   value="/00-CNM_Landing.jsp" />
</definition>

I want to be able to set the value of the body parameter in my java Action class.
What would I get from the ActionMapping or ActionForm to do this?

public class TileForwardAction extends Action
{
public ActionForward execute(ActionMapping mapping, ActionForm arg1,
        HttpServletRequest arg2, HttpServletResponse arg3) throws Exception
{
    return mapping.findForward("theTile");           
}
}

the struts config file looks like

  <action-mappings>

  <action   path = "/index"
            type = "com.bellsouth.snt.cnmp.ui.action.TileForwardAction"
            scope = "request"
            input = "cnmp.body.index"
            parameter= "theTile"
    >    
      <forward name="theTile" path="cnmp.body.index"/>       
  </action>

Thank you


Inspired by the accepted answer I came up with the following solution

In the page defined in the tile def I have the following

<% String destAttr=(String)request.getAttribute("dest"); %>

<jsp:include page="<%=destAttr%>" flush="true" />

In the action class (because I was lazy) I have the following

    request.setAttribute("dest", "landingB.jsp");

And it worked.

  • 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-11T19:17:54+00:00Added an answer on May 11, 2026 at 7:17 pm

    You might want to look into tiles support for Controller Classes. The tiles def entry would look something like this:

    <definition 
      name="cnmp.body.index" 
      extends="cnmp.mainLayout"
      controllerClass="org.yourpackage.YourControllerClass">
      <put name="title"  value="CNM Portal" />
      <put name="bodytitle"  value="Home" />
      <put name="body"   value="/00-CNM_Landing.jsp" />
    </definition>
    

    then the YourControllerClass would implement the perform() method like:

    public class YourControllerClasss implements Controller
        public void perform(ComponentContext context,
          HttpServletRequest request,
          HttpServletResponse response,
          ServletContext servletContext)
          throws ServletException, IOException {
    
          //some logic to determine what the 'body' should be
    
          if (service.isUp()){
            request.setAttribute("nameOfJSPToImport", "/jsps/import-me.jsp");
          }else{
            request.setAttribute("nameOfJSPToImport", "/jsps/import-me-instead.jsp");
          }
    
        }
    }
    

    The above example could be done directly in your action without use of TilesControllers, but the TilesController can help make your Actions less cluttered. The overall goal regardless of technique is to parameterize the NM_Landing.jsp then actually changing which jsp the “body” attribute of the definition is using. For example, NM_landing.jsp could be nothing more than include call something like

    <c:import url="${nameOfJSPToImport}" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 124k
  • Answers 124k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you running on OS 3.0? I saw the same… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer It looks like you need to register Apache::Session::Memcached with Apache::Session::Wrapper,… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer Use DATENAME or DATEPART: SELECT DATENAME(dw,GETDATE()) -- Friday SELECT DATEPART(dw,GETDATE())… May 12, 2026 at 1:19 am

Related Questions

I am using Java 6 64-bit and STANDALONE Tomcat 6.0.18 on Vista 64-bit. I
I am using the Struts iterator tag and trying to get 3 elements of
I was poking around in XNA and saw that the Vector3 class in it
What unusual, unexpected consequences have occurred in terms of performance, memory, etc when switching

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.