You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2007/02/10 10:59:03 UTC
svn commit: r505669 - in
/tiles/examples/trunk/tiles-showcase/src/main/webapp: WEB-INF/ common/
tutorial/common/ tutorial/common/menu/
Author: apetrelli
Date: Sat Feb 10 01:59:03 2007
New Revision: 505669
URL: http://svn.apache.org/viewvc?view=rev&rev=505669
Log:
TILES-11
Fixed something to let the tutorial examples show.
Modified:
tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-defs.xml
tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-doc-defs.xml
tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs.xml
tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/web.xml
tiles/examples/trunk/tiles-showcase/src/main/webapp/common/submenu.jsp
tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuLinks.jsp
tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menuViewSrc.jsp
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-defs.xml
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-defs.xml?view=diff&rev=505669&r1=505668&r2=505669
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-defs.xml (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-defs.xml Sat Feb 10 01:59:03 2007
@@ -105,12 +105,10 @@
<definition name="common.menu.doc" template="/layouts/menu.jsp" >
<putAttribute name="title" value="Documentation" />
<putListAttribute name="items" >
- <item value="Home" link="/doc/index.jsp" />
+ <item value="Home" link="/doc/index.jsp" />
<item value="Live Examples" link="/examples/index.jsp" />
<item value="Quick overview" link="/test/quickOverview.jsp" />
- <!--
- <item value="Tutorial" link="/doc/tutorial.jsp" />
- -->
+ <item value="Tutorial" link="/doc/tutorial.jsp" />
<item value="Tutorial Live Examples" link="/tutorial/index.jsp" />
<!--
<item value="Tiles Tags" link="/doc/tilesTags.jsp" />
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-doc-defs.xml
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-doc-defs.xml?view=diff&rev=505669&r1=505668&r2=505669
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-doc-defs.xml (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-doc-defs.xml Sat Feb 10 01:59:03 2007
@@ -85,7 +85,7 @@
<putAttribute name="title" value="Documentation" />
<putListAttribute name="items" >
<item value="Home" link="/index.jsp" />
- <item value="Live Examples (new)" link="/examples/index.jsp" />
+ <item value="Live Examples (new)" link="/switch.do?prefix=/examples&page=/index.jsp" />
<!--
<item> <value>Commented Examples</value>
<link>/examples/index.jsp</link>
@@ -93,10 +93,8 @@
</item>
-->
<item value="Quick overview" link="/doc/quickOverview.jsp" />
- <!--
- <item value="Tutorial" link="/doc/tutorial.jsp" />
- -->
- <item value="Tutorial Live Examples" link="/tutorial/index.jsp" />
+ <item value="Tutorial" link="/switch.do?prefix=/tutorial&page=/index.jsp" />
+ <item value="Tutorial Live Examples" link="/switch.do?prefix=/tutorial&page=/index.jsp" />
<item value="Download" link="/doc/download.jsp" />
<item value="Installation" link="/doc/installation.jsp" />
<item value="User Guide" link="/doc/userGuide.jsp" />
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs.xml
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs.xml?view=diff&rev=505669&r1=505668&r2=505669
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs.xml (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/tiles-tutorial-defs.xml Sat Feb 10 01:59:03 2007
@@ -87,87 +87,115 @@
<definition name="menu.documentation" template="/common/submenu.jsp" >
<putAttribute name="title" value="Tiles" />
<putListAttribute name="items" >
- <addAttribute value="Home" />
+ <putListAttribute name="none">
+ <addAttribute value="Home" />
+ <addAttribute value="/index.jsp" type="string"/>
+ </putListAttribute>
</putListAttribute>
<putListAttribute name="links" >
- <addAttribute value="/index.jsp" />
</putListAttribute>
</definition>
<!-- menu logo definition -->
<definition name="menu.links" template="/common/submenu.jsp" >
<putAttribute name="title" value="Tutorial" />
- <putListAttribute name="items" >
- <addAttribute value="Home" />
- <addAttribute value="Basic Page" />
- <addAttribute value="First Portal" />
- <addAttribute value="First Definition" />
- <addAttribute value="Overloaded Definition" />
- <addAttribute value="Extended Definition" />
- <addAttribute value="Dynamic Portal" />
- <addAttribute value="Dynamic Portal Prefs" />
- <addAttribute value="Struts Forward" />
- <addAttribute value="Definition Tag" />
- <addAttribute value="Extended Definition Tag" />
- <addAttribute value="Dynamic Definition" />
- <addAttribute value="Frame Example" />
- <addAttribute value="Invoice" />
- </putListAttribute>
- <putListAttribute name="links" >
- <addAttribute value="/tutorial/index.jsp" />
- <addAttribute value="/tutorial/basicPage.jsp" />
- <addAttribute value="/tutorial/portalPage.jsp" />
- <addAttribute value="/tutorial/firstDefinition.jsp" />
- <addAttribute value="/tutorial/overloadDefinitionParameters.jsp" />
- <addAttribute value="/tutorial/extendedDefinition.jsp" />
- <addAttribute value="/tutorial/dynPortal/index.jsp" />
- <addAttribute value="/tutorial/dynPortal/myPortalPrefs.jsp" />
- <addAttribute value="/tutorial/strutsForward.jsp" />
- <addAttribute value="/tutorial/definitionTag.jsp" />
- <addAttribute value="/tutorial/extendedDefinitionTag.jsp" />
- <addAttribute value="/tutorial/dynTemplate.do" />
- <addAttribute value="/tutorial/basicFramesetPage.jsp" />
- <addAttribute value="/tutorial/invoice/index.jsp" />
+ <putListAttribute name="items">
+ <putListAttribute name="none">
+ <addAttribute value="Home" />
+ <addAttribute value="/index.jsp" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="Basic Page" />
+ <addAttribute value="/basicPage.jsp" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="First Portal" />
+ <addAttribute value="/portalPage.jsp" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="First Definition" />
+ <addAttribute value="/firstDefinition.jsp" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="Overloaded Definition" />
+ <addAttribute value="/overloadDefinitionParameters.jsp" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="Extended Definition" />
+ <addAttribute value="/extendedDefinition.jsp" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="Dynamic Portal" />
+ <addAttribute value="/dynPortal/index.jsp" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="Dynamic Portal Prefs" />
+ <addAttribute value="/dynPortal/myPortalPrefs.jsp" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="Struts Forward" />
+ <addAttribute value="/strutsForward.jsp" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="Definition Tag" />
+ <addAttribute value="/definitionTag.jsp" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="Extended Definition Tag" />
+ <addAttribute value="/extendedDefinitionTag.jsp" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="Dynamic Definition" />
+ <addAttribute value="/dynTemplate.do" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="Frame Example" />
+ <addAttribute value="/basicFramesetPage.jsp" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="Invoice" />
+ <addAttribute value="/invoice/index.jsp" />
+ </putListAttribute>
</putListAttribute>
</definition>
<!-- Menu sources definition -->
<definition name="menu.src" template="/tutorial/common/menuViewSrc.jsp" >
<putListAttribute name="list" >
- <addAttribute value="/tutorial/index.jsp" />
- <addAttribute value="/tutorial/basicPage.jsp" />
- <addAttribute value="/tutorial/portalPage.jsp" />
- <addAttribute value="/tutorial/firstDefinition.jsp" />
- <addAttribute value="/tutorial/overloadDefinitionParameters.jsp" />
- <addAttribute value="/tutorial/extendedDefinition.jsp" />
- <addAttribute value="/tutorial/definitionTag.jsp" />
- <addAttribute value="/tutorial/extendedDefinitionTag.jsp" />
- <addAttribute value="/tutorial/basicFramesetPage.jsp" />
- <addAttribute value="/tutorial/WEB-INF/templateDefinitions.xml" />
-
- <addAttribute value="/tutorial/basic/myLayout.jsp" />
- <addAttribute value="/tutorial/basic/hello.jsp" />
- <addAttribute value="/tutorial/basic/menu.jsp" />
- <addAttribute value="/tutorial/portal/portalBody.jsp" />
-
- <addAttribute value="/tutorial/common/footer.jsp" />
- <addAttribute value="/tutorial/common/menu.jsp" />
- <addAttribute value="/tutorial/common/submenu.jsp" />
- <addAttribute value="/tutorial/common/menuViewSrc.jsp" />
- <addAttribute value="/tutorial/common/viewSrc.jsp" />
- <addAttribute value="/tutorial/common/viewSrcBody.jsp" />
+ <addAttribute value="/index.jsp" />
+ <addAttribute value="/basicPage.jsp" />
+ <addAttribute value="/portalPage.jsp" />
+ <addAttribute value="/firstDefinition.jsp" />
+ <addAttribute value="/overloadDefinitionParameters.jsp" />
+ <addAttribute value="/extendedDefinition.jsp" />
+ <addAttribute value="/definitionTag.jsp" />
+ <addAttribute value="/extendedDefinitionTag.jsp" />
+ <addAttribute value="/basicFramesetPage.jsp" />
+ <addAttribute value="/WEB-INF/templateDefinitions.xml" />
+
+ <addAttribute value="/basic/myLayout.jsp" />
+ <addAttribute value="/basic/hello.jsp" />
+ <addAttribute value="/basic/menu.jsp" />
+ <addAttribute value="/portal/portalBody.jsp" />
+
+ <addAttribute value="/common/footer.jsp" />
+ <addAttribute value="/common/menu.jsp" />
+ <addAttribute value="/common/submenu.jsp" />
+ <addAttribute value="/common/menuViewSrc.jsp" />
+ <addAttribute value="/common/viewSrc.jsp" />
+ <addAttribute value="/common/viewSrcBody.jsp" />
- <addAttribute value="/tutorial/common/menu/menuLogo.jsp" />
- <addAttribute value="/tutorial/common/menu/menuLinks.jsp" />
- <addAttribute value="/tutorial/common/menu/menuSrc.jsp" />
-
- <addAttribute value="/tutorial/layout/classicLayout.jsp" />
- <addAttribute value="/tutorial/layout/columnsLayout.jsp" />
- <addAttribute value="/tutorial/layout/vboxLayout.jsp" />
+ <addAttribute value="/common/menu/menuLogo.jsp" />
+ <addAttribute value="/common/menu/menuLinks.jsp" />
+ <addAttribute value="/common/menu/menuSrc.jsp" />
+
+ <addAttribute value="/layout/classicLayout.jsp" />
+ <addAttribute value="/layout/columnsLayout.jsp" />
+ <addAttribute value="/layout/vboxLayout.jsp" />
- <addAttribute value="/tutorial/invoice/editAddress.jsp" />
- <addAttribute value="/tutorial/invoice/editInvoice.jsp" />
- <addAttribute value="/tutorial/invoice/index.jsp" />
+ <addAttribute value="/invoice/editAddress.jsp" />
+ <addAttribute value="/invoice/editInvoice.jsp" />
+ <addAttribute value="/invoice/index.jsp" />
</putListAttribute>
</definition>
@@ -175,14 +203,18 @@
<definition name="menu.lang" template="/common/submenu.jsp" >
<putAttribute name="title" value="Language" />
<putListAttribute name="items" >
- <addAttribute value="Français" />
- <addAttribute value="English" />
- <addAttribute value="Deutsch" />
- </putListAttribute>
- <putListAttribute name="links" >
- <addAttribute value="/tutorial/lang.do?language=FR" />
- <addAttribute value="/tutorial/lang.do?language=UK" />
- <addAttribute value="/tutorial/lang.do?language=DE" />
+ <putListAttribute name="none">
+ <addAttribute value="Français" />
+ <addAttribute value="/tutorial/lang.do?language=FR" />
+ </putListAttribute>
+ <putListAttribute name="none">
+ <addAttribute value="English" />
+ <addAttribute value="/tutorial/lang.do?language=UK" />
+ </putListAttribute>
+ <putListAttribute name="links" >
+ <addAttribute value="Deutsch" />
+ <addAttribute value="/tutorial/lang.do?language=DE" />
+ </putListAttribute>
</putListAttribute>
</definition>
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/web.xml?view=diff&rev=505669&r1=505668&r2=505669
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/web.xml (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/WEB-INF/web.xml Sat Feb 10 01:59:03 2007
@@ -51,6 +51,10 @@
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
+ <param-name>config/doc</param-name>
+ <param-value>/WEB-INF/struts-doc-config.xml</param-value>
+ </init-param>
+ <init-param>
<param-name>config/examples</param-name>
<param-value>/WEB-INF/struts-examples-config.xml</param-value>
</init-param>
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/common/submenu.jsp
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/common/submenu.jsp?view=diff&rev=505669&r1=505668&r2=505669
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/common/submenu.jsp (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/common/submenu.jsp Sat Feb 10 01:59:03 2007
@@ -23,7 +23,9 @@
--%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
+<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
+<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ page import="java.util.Iterator" %>
@@ -44,39 +46,20 @@
<% pageContext.setAttribute( "selected", "" ); %>
</logic:notPresent>
-<%-- Prepare the links list to be iterated --%>
-<bean:define id="links" name="links" type="java.util.List" scope="page" />
-<% Iterator i = links.iterator(); %>
-
-<%-- iterate on items list --%>
-<%-- Normally, we should write something like this :
- <logic:iterate id="item" name="items" type="java.lang.String" >
- But, Struts doesn't declare the TEI class for iterate, and
- some web container deal badly with the declared variable.
- So, we use what follow instead.
- --%>
-<logic:iterate id="iterateItem" name="items" >
-<bean:define id="item" name="iterateItem" type="java.lang.String" scope="page" />
-
-
+<c:forEach var="iterateItem" items="${items}" >
<tr>
<td width="10" valign="top" ></td>
<td valign="top" >
<%-- check if selected --%>
- <logic:notEqual name="selected" value="<%=item%>">
- <% // Compute link value
- String link = (String)i.next();
- if(link.startsWith("/") )
- link = request.getContextPath() + link;
- %>
- <font size="-1"><a href="<%=link%>"><%=item%></a></font>
+ <logic:notEqual name="selected" value="${iterateItem.value[0].value}">
+ <font size="-1"><html:link page="${iterateItem.value[1].value}">${iterateItem.value[0].value}</html:link></font>
</logic:notEqual>
- <logic:equal name="selected" value="<%=item%>">
- <font size="-1" color="fuchsia"><%=item%></font>
+ <logic:equal name="selected" value="${iterateItem.value[0].value}">
+ <font size="-1" color="fuchsia">${iterateItem.value[0].value}</font>
</logic:equal>
</td>
</tr>
-</logic:iterate>
+</c:forEach>
</table>
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuLinks.jsp
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuLinks.jsp?view=diff&rev=505669&r1=505668&r2=505669
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuLinks.jsp (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menu/menuLinks.jsp Sat Feb 10 01:59:03 2007
@@ -26,13 +26,17 @@
<tiles:insertTemplate template="/common/submenu.jsp" flush="true">
<tiles:putAttribute name="title" value="Main Menu" />
<tiles:putListAttribute name="items" >
- <tiles:add value="Home" />
- <tiles:add value="Basic Page" />
- <tiles:add value="First Portal" />
- </tiles:putListAttribute>
- <tiles:putListAttribute name="links" >
- <tiles:add value="/tutorial/index.jsp" />
- <tiles:add value="/tutorial/basicPage.jsp" />
- <tiles:add value="/tutorial/portalPage.jsp" />
+ <tiles:putListAttribute name="none">
+ <tiles:putAttribute value="Home" />
+ <tiles:putAttribute value="/tutorial/index.jsp" />
+ </tiles:putListAttribute>
+ <tiles:putListAttribute name="none">
+ <tiles:putAttribute value="Basic Page" />
+ <tiles:putAttribute value="/tutorial/basicPage.jsp" />
+ </tiles:putListAttribute>
+ <tiles:putListAttribute name="none">
+ <tiles:putAttribute value="First Portal" />
+ <tiles:putAttribute value="/tutorial/portalPage.jsp" />
+ </tiles:putListAttribute>
</tiles:putListAttribute>
</tiles:insertTemplate>
Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menuViewSrc.jsp
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menuViewSrc.jsp?view=diff&rev=505669&r1=505668&r2=505669
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menuViewSrc.jsp (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/common/menuViewSrc.jsp Sat Feb 10 01:59:03 2007
@@ -25,6 +25,7 @@
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
+<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%-- Menu of sources component
This component is a menu of sources. When a source is clicked, its
@@ -38,23 +39,17 @@
<tiles:importAttribute />
<%-- Set default viewer if not specified --%>
-<logic:notPresent name="viewerPath" >
- <% pageContext.setAttribute( "viewerPath", request.getContextPath()+"/tutorial/common/viewSrc.jsp" ); %>
-</logic:notPresent>
-<bean:define id="viewerPath" name="viewerPath" type="java.lang.String" />
<table>
<tr><th colspan=2><div align="left"><strong>JSP Sources</strong></div></th></tr>
<%-- Iterate on sources list --%>
<logic:iterate id="iterateItem" name="list" >
-<bean:define id="srcPath" name="iterateItem" type="java.lang.String" scope="page" />
-
<tr>
<td width="10" align="center"></td>
<td width="120">
<font size="-2">
- <a href="<%=viewerPath%>?src=<%=srcPath%>"><%=srcPath%></a>
+ <a href="<html:rewrite page="/common/viewSrc.jsp">?src=<html:rewrite page="${iterateItem.value}" />"><html:rewrite page="${iterateItem.value}" /></a>
</font>
</td>
</tr>