Solved

A Tiles question, about putList I think

Posted on 2013-02-03
3
258 Views
Last Modified: 2013-02-07
A complete newbie to Tiles, I have a page like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri='/WEB-INF/struts-tiles.tld' prefix='template' %>
<template:insert page='/template/template.jsp'>
  <template:put name='title' value='Foo - Bar Response'/>
  <template:put name='header' value='/template/header.jsp' />
  <template:put name='error' value='/template/error.jsp' />
  <template:put name='sidebar' value='/template/sidebar.jsp' />
  <template:put name='content' value='/content/providerInquiryResultsContent.jsp'/>
  <template:put name='footer' value='/template/footer.html' /> 
</template:insert>

Open in new window


My requirement is to insert some additional jsp content -- for example moreStuff.jsp -- into the sidebar after /template/sidebar.jsp, which I cannot modify. As far as I can tell I do that with a putList, but what is the syntax?

As an aside I have not been able to find any central definition of templates as the tiles-defs.xml is almost empty and I don't see any other suspects. So I'm not clear whether I make changes here only or somewhere else first.
0
Comment
Question by:FelineConspiracy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 36

Accepted Solution

by:
mccarl earned 500 total points
ID: 38849915
I have not been able to find any central definition of templates as the tiles-defs.xml is almost empty
The definition IS the bit of JSP that you included in your question. The definition can be placed in the tiles-defs.xml file (where it can be reused) or it can be defined explictly in the JSP (as you have here).

Also, I don't think the putList tag will do what you want. Not without changing the /template/template.jsp file to actually handle the list. But if you are able to change that file (rather than sidebar.jsp), you would just change it to accept a 'sidebar2' attribute, and then you could add another <template:put ...  to the above to pass the .jsp for your additional content.

If you aren't able to modify either the sidebar.jsp or template.jsp then I think you are stuck. I can't think of any other way to do what you want!
0
 
LVL 7

Expert Comment

by:gudii9
ID: 38857072
In Tiles we can define the definition in the tiles-defs.xml which specifies the different components to "plugin" to generate the output. This eliminates the need to define extra jsp file for each content file.

Here is interesting link

http://www.roseindia.net/struts/using-tiles-defs-xml.shtml
0
 

Author Closing Comment

by:FelineConspiracy
ID: 38865285
Thank you. In this case I think I will reverse direction and bring sidebar.jsp into my page. My page is a special case in that there is no form for the user to fill out so I really cannot use the template profitably anyway.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question