Solved

A Tiles question, about putList I think

Posted on 2013-02-03
3
256 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
why cannot we forward request once the response is committed 2 53
servlet filter example 37 97
jmss example java 2 46
Java array sort 10 59
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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.

737 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