tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Pratt <thechrispr...@gmail.com>
Subject Re: how to add the js refer in the page which extends the template
Date Tue, 15 Feb 2011 16:28:16 GMT
If you search the list archives, I know I put some examples up here before.
  (*Chris*)

On Tue, Feb 15, 2011 at 6:46 AM, Antonio Petrelli <
antonio.petrelli@gmail.com> wrote:

> 2011/2/15 maven apache <apachemaven0@gmail.com>:
> > 2011/2/15 Antonio Petrelli <antonio.petrelli@gmail.com>
> >
> >> 2011/2/15 maven apache <apachemaven0@gmail.com>:
> >> > And now I need some javascripts in the home.jsp,however I do not know
> >> where
> >> > to add it.
> >> >
> >> > I can add it in the home_body.jsp,but I prefer to add it in a external
> >> > file,so where to define it?
> >> >
> >> > I mean where to write this  <script ... src=xx.js /> ?
> >>
> >> This is the way I prefer, however I think there is plenty of similar,
> >> or better, solutions.
> >> First of all, identify the outer template, the one containing the
> >> <HEAD> elements.
> >> In this template, import a list attribute and iterate over it to
> >> create all script elements:
> >>
> >> <tiles:importAttribute name="scriptList" />
> >> <c:forEach values="${scriptList}" var="script">
> >> <script src="${script}" ...></script>
> >> </c:forEach>
> >>
> >> In all your definitions (or on all base definitions you have) put
> >> these attributes:
> >>
> >> <definition name="...." template="_thetemplateabove_">
> >> <put-list-attribute name="scriptList">
> >> <add-attribute value="/scripts/xx.js">
> >> ...
> >> </put-list-attribute>
> >> </definition>
> >>
> >> Do you like it?
> >>
> >>
> > Thanks for your reply.
> >
> > In fact,I am not exactly sure I know how to do.
> >
> > Can you give me a live example according my example?
>
> No live examples, sorry. This is the doc about list attributes:
> http://tiles.apache.org/framework/tutorial/advanced/list-attributes.html
>
> Antonio
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message