Solved

A Tiles question, about putList I think

Posted on 2013-02-03
3
253 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
3 Comments
 
LVL 35

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 214
jsp error 6 27
wild fly 8 startup error 2 14
spring maven example issues 3 13
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 …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.

820 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