You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by dg...@apache.org on 2005/06/14 23:59:17 UTC
svn commit: r190662 [6/6] - in /struts/sandbox/trunk/tiles: ./ core-library/
core-library/src/ core-library/src/conf/ core-library/src/java/
core-library/src/java/org/ core-library/src/java/org/apache/
core-library/src/java/org/apache/taglib/
core-library/src/java/org/apache/taglib/tiles/
core-library/src/java/org/apache/taglib/tiles/doc-files/
core-library/src/java/org/apache/taglib/tiles/util/
core-library/src/java/org/apache/tiles/
core-library/src/java/org/apache/tiles/beans/
core-library/src/java/org/apache/tiles/definition/
core-library/src/java/org/apache/tiles/doc-files/
core-library/src/java/org/apache/tiles/servlets/
core-library/src/java/org/apache/tiles/xmlDefinition/
core-library/src/java/org/apache/util/ core-library/src/test/ examples/
examples/simple/ examples/simple/WEB-INF/ examples/simple/WEB-INF/lib/
examples/simple/graphics/ examples/simple/graphics/flags/
Added: struts/sandbox/trunk/tiles/core-library/src/java/org/apache/util/PropertyMessageResources.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/core-library/src/java/org/apache/util/PropertyMessageResources.java?rev=190662&view=auto
==============================================================================
--- struts/sandbox/trunk/tiles/core-library/src/java/org/apache/util/PropertyMessageResources.java (added)
+++ struts/sandbox/trunk/tiles/core-library/src/java/org/apache/util/PropertyMessageResources.java Tue Jun 14 14:59:13 2005
@@ -0,0 +1,290 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Concrete subclass of <code>MessageResources</code> that reads message keys
+ * and corresponding strings from named property resources in the same manner
+ * that <code>java.util.PropertyResourceBundle</code> does. The
+ * <code>base</code> property defines the base property resource name, and
+ * must be specified.
+ * <p>
+ * <strong>IMPLEMENTATION NOTE</strong> - This class trades memory for
+ * speed by caching all messages located via generalizing the Locale under
+ * the original locale as well.
+ * This results in specific messages being stored in the message cache
+ * more than once, but improves response time on subsequent requests for
+ * the same locale + key combination.
+ *
+ * @author Craig R. McClanahan
+ * @author David Graham
+ * @version $Revision: 1.8 $ $Date: 2003/04/19 19:06:02 $
+ */
+public class PropertyMessageResources extends MessageResources {
+
+
+ // ----------------------------------------------------------- Constructors
+
+
+ /**
+ * Construct a new PropertyMessageResources according to the
+ * specified parameters.
+ *
+ * @param factory The MessageResourcesFactory that created us
+ * @param config The configuration parameter for this MessageResources
+ */
+ public PropertyMessageResources(MessageResourcesFactory factory,
+ String config) {
+
+ super(factory, config);
+ log.info("Initializing, config='" + config + "'");
+
+ }
+
+
+ /**
+ * Construct a new PropertyMessageResources according to the
+ * specified parameters.
+ *
+ * @param factory The MessageResourcesFactory that created us
+ * @param config The configuration parameter for this MessageResources
+ * @param returnNull The returnNull property we should initialize with
+ */
+ public PropertyMessageResources(MessageResourcesFactory factory,
+ String config, boolean returnNull) {
+
+ super(factory, config, returnNull);
+ log.info("Initializing, config='" + config +
+ "', returnNull=" + returnNull);
+
+ }
+
+
+ // ------------------------------------------------------------- Properties
+
+
+ /**
+ * The set of locale keys for which we have already loaded messages, keyed
+ * by the value calculated in <code>localeKey()</code>.
+ */
+ protected HashMap locales = new HashMap();
+
+
+ /**
+ * The <code>Log</code> instance for this class.
+ */
+ protected static final Log log =
+ LogFactory.getLog(PropertyMessageResources.class);
+
+
+ /**
+ * The cache of messages we have accumulated over time, keyed by the
+ * value calculated in <code>messageKey()</code>.
+ */
+ protected HashMap messages = new HashMap();
+
+
+ // --------------------------------------------------------- Public Methods
+
+
+ /**
+ * Returns a text message for the specified key, for the default Locale.
+ * A null string result will be returned by this method if no relevant
+ * message resource is found for this key or Locale, if the
+ * <code>returnNull</code> property is set. Otherwise, an appropriate
+ * error message will be returned.
+ * <p>
+ * This method must be implemented by a concrete subclass.
+ *
+ * @param locale The requested message Locale, or <code>null</code>
+ * for the system default Locale
+ * @param key The message key to look up
+ * @return text message for the specified key and locale
+ */
+ public String getMessage(Locale locale, String key) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("getMessage(" + locale + "," + key + ")");
+ }
+
+ // Initialize variables we will require
+ String localeKey = localeKey(locale);
+ String originalKey = messageKey(localeKey, key);
+ String messageKey = null;
+ String message = null;
+ int underscore = 0;
+ boolean addIt = false; // Add if not found under the original key
+
+ // Loop from specific to general Locales looking for this message
+ while (true) {
+
+ // Load this Locale's messages if we have not done so yet
+ loadLocale(localeKey);
+
+ // Check if we have this key for the current locale key
+ messageKey = messageKey(localeKey, key);
+ synchronized (messages) {
+ message = (String) messages.get(messageKey);
+ if (message != null) {
+ if (addIt) {
+ messages.put(originalKey, message);
+ }
+ return (message);
+ }
+ }
+
+ // Strip trailing modifiers to try a more general locale key
+ addIt = true;
+ underscore = localeKey.lastIndexOf("_");
+ if (underscore < 0) {
+ break;
+ }
+ localeKey = localeKey.substring(0, underscore);
+
+ }
+
+ // Try the default locale if the current locale is different
+ if (!defaultLocale.equals(locale)) {
+ localeKey = localeKey(defaultLocale);
+ messageKey = messageKey(localeKey, key);
+ loadLocale(localeKey);
+ synchronized (messages) {
+ message = (String) messages.get(messageKey);
+ if (message != null) {
+ messages.put(originalKey, message);
+ return (message);
+ }
+ }
+ }
+
+ // As a last resort, try the default Locale
+ localeKey = "";
+ messageKey = messageKey(localeKey, key);
+ loadLocale(localeKey);
+ synchronized (messages) {
+ message = (String) messages.get(messageKey);
+ if (message != null) {
+ messages.put(originalKey, message);
+ return (message);
+ }
+ }
+
+ // Return an appropriate error indication
+ if (returnNull) {
+ return (null);
+ } else {
+ return ("???" + messageKey(locale, key) + "???");
+ }
+
+ }
+
+
+ // ------------------------------------------------------ Protected Methods
+
+
+ /**
+ * Load the messages associated with the specified Locale key. For this
+ * implementation, the <code>config</code> property should contain a fully
+ * qualified package and resource name, separated by periods, of a series
+ * of property resources to be loaded from the class loader that created
+ * this PropertyMessageResources instance. This is exactly the same name
+ * format you would use when utilizing the
+ * <code>java.util.PropertyResourceBundle</code> class.
+ *
+ * @param localeKey Locale key for the messages to be retrieved
+ */
+ protected synchronized void loadLocale(String localeKey) {
+
+ if (log.isTraceEnabled()) {
+ log.trace("loadLocale(" + localeKey + ")");
+ }
+
+ // Have we already attempted to load messages for this locale?
+ if (locales.get(localeKey) != null) {
+ return;
+ }
+ locales.put(localeKey, localeKey);
+
+ // Set up to load the property resource for this locale key, if we can
+ String name = config.replace('.', '/');
+ if (localeKey.length() > 0) {
+ name += "_" + localeKey;
+ }
+ name += ".properties";
+ InputStream is = null;
+ Properties props = new Properties();
+
+ // Load the specified property resource
+ if (log.isTraceEnabled()) {
+ log.trace(" Loading resource '" + name + "'");
+ }
+
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ if (classLoader == null) {
+ classLoader = this.getClass().getClassLoader();
+ }
+
+ is = classLoader.getResourceAsStream(name);
+ if (is != null) {
+ try {
+ props.load(is);
+
+ } catch (IOException e) {
+ log.error("loadLocale()", e);
+ } finally {
+ try {
+ is.close();
+ } catch (IOException e) {
+ log.error("loadLocale()", e);
+ }
+ }
+ }
+
+ if (log.isTraceEnabled()) {
+ log.trace(" Loading resource completed");
+ }
+
+ // Copy the corresponding values into our cache
+ if (props.size() < 1) {
+ return;
+ }
+
+ synchronized (messages) {
+ Iterator names = props.keySet().iterator();
+ while (names.hasNext()) {
+ String key = (String) names.next();
+ if (log.isTraceEnabled()) {
+ log.trace(" Saving message key '" + messageKey(localeKey, key));
+ }
+ messages.put(messageKey(localeKey, key), props.getProperty(key));
+ }
+ }
+
+ }
+
+
+}
Added: struts/sandbox/trunk/tiles/core-library/src/java/org/apache/util/PropertyMessageResourcesFactory.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/core-library/src/java/org/apache/util/PropertyMessageResourcesFactory.java?rev=190662&view=auto
==============================================================================
--- struts/sandbox/trunk/tiles/core-library/src/java/org/apache/util/PropertyMessageResourcesFactory.java (added)
+++ struts/sandbox/trunk/tiles/core-library/src/java/org/apache/util/PropertyMessageResourcesFactory.java Tue Jun 14 14:59:13 2005
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.util;
+
+
+/**
+ * Factory for <code>PropertyMessageResources</code> instances. The
+ * configuration paramter for such instances is the base Java package
+ * name of the resources entries from which our keys and values will be
+ * loaded.
+ *
+ * @author Craig R. McClanahan
+ * @version $Revision: 1.2 $ $Date: 2001/02/12 00:32:14 $
+ */
+
+public class PropertyMessageResourcesFactory extends MessageResourcesFactory {
+
+
+ // --------------------------------------------------------- Public Methods
+
+
+ /**
+ * Create and return a newly instansiated <code>MessageResources</code>.
+ * This method must be implemented by concrete subclasses.
+ *
+ * @param config Configuration parameter(s) for the requested bundle
+ */
+ public MessageResources createResources(String config) {
+
+ return new PropertyMessageResources(this, config, this.returnNull);
+
+ }
+
+
+}
Added: struts/sandbox/trunk/tiles/examples/simple/README.txt
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/README.txt?rev=190662&view=auto
==============================================================================
--- struts/sandbox/trunk/tiles/examples/simple/README.txt (added)
+++ struts/sandbox/trunk/tiles/examples/simple/README.txt Tue Jun 14 14:59:13 2005
@@ -0,0 +1,5 @@
+This is a simple application that illustrates fundamental Tiles concepts. The application is documented in the file tiles.pdf, in the top-level directory of the Tiles distribution.
+
+Copy the contents of this directory into a directory in your servlet container's
+webapps directory. Depending on your container, you may have to restart the
+container to access the application you just created.
Added: struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/commons-beanutils.jar
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/commons-beanutils.jar?rev=190662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/commons-beanutils.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/commons-digester.jar
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/commons-digester.jar?rev=190662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/commons-digester.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/jstl.jar
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/jstl.jar?rev=190662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/jstl.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/standard.jar
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/standard.jar?rev=190662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/standard.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/tiles-core.jar
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/tiles-core.jar?rev=190662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: struts/sandbox/trunk/tiles/examples/simple/WEB-INF/lib/tiles-core.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: struts/sandbox/trunk/tiles/examples/simple/WEB-INF/tiles.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/WEB-INF/tiles.xml?rev=190662&view=auto
==============================================================================
--- struts/sandbox/trunk/tiles/examples/simple/WEB-INF/tiles.xml (added)
+++ struts/sandbox/trunk/tiles/examples/simple/WEB-INF/tiles.xml Tue Jun 14 14:59:13 2005
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration//EN"
+ "http://jakarta.apache.org/struts/dtds/tiles-config.dtd">
+
+<tiles-definitions>
+ <definition name="header-footer-sidebar"
+ path="/header-footer-sidebar-layout.jsp">
+ <put name="header" value="/header.jsp"/>
+ <put name="sidebar" value="/sidebar.jsp"/>
+ <put name="content"/>
+ <put name="footer" value="/footer.jsp"/>
+ </definition>
+
+ <definition name="login-tile" extends="header-footer-sidebar">
+ <put name="content" value="/loginContent.jsp"/>
+ </definition>
+
+ <definition name="preferences-tile" extends="header-footer-sidebar">
+ <put name="content" value="/preferencesContent.jsp"/>
+ </definition>
+</tiles-definitions>
Added: struts/sandbox/trunk/tiles/examples/simple/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/WEB-INF/web.xml?rev=190662&view=auto
==============================================================================
--- struts/sandbox/trunk/tiles/examples/simple/WEB-INF/web.xml (added)
+++ struts/sandbox/trunk/tiles/examples/simple/WEB-INF/web.xml Tue Jun 14 14:59:13 2005
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
+ "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
+
+<web-app>
+ <servlet>
+ <servlet-name>Tiles Servlet</servlet-name>
+ <servlet-class>org.apache.tiles.servlets.TilesServlet</servlet-class>
+ <init-param>
+ <param-name>definitions-config</param-name>
+ <param-value>/WEB-INF/tiles.xml</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- Define the welcome file -->
+ <welcome-file-list>
+ <welcome-file>/login.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
+
+
Added: struts/sandbox/trunk/tiles/examples/simple/footer.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/footer.jsp?rev=190662&view=auto
==============================================================================
--- struts/sandbox/trunk/tiles/examples/simple/footer.jsp (added)
+++ struts/sandbox/trunk/tiles/examples/simple/footer.jsp Tue Jun 14 14:59:13 2005
@@ -0,0 +1 @@
+<hr>Thanks for stopping by on <%= new java.util.Date() %>
Added: struts/sandbox/trunk/tiles/examples/simple/graphics/blueAndWhiteBackground.gif
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/graphics/blueAndWhiteBackground.gif?rev=190662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: struts/sandbox/trunk/tiles/examples/simple/graphics/blueAndWhiteBackground.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: struts/sandbox/trunk/tiles/examples/simple/graphics/flags/britain_flag.gif
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/graphics/flags/britain_flag.gif?rev=190662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: struts/sandbox/trunk/tiles/examples/simple/graphics/flags/britain_flag.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: struts/sandbox/trunk/tiles/examples/simple/graphics/flags/chinese_flag.gif
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/graphics/flags/chinese_flag.gif?rev=190662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: struts/sandbox/trunk/tiles/examples/simple/graphics/flags/chinese_flag.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: struts/sandbox/trunk/tiles/examples/simple/graphics/flags/german_flag.gif
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/graphics/flags/german_flag.gif?rev=190662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: struts/sandbox/trunk/tiles/examples/simple/graphics/flags/german_flag.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: struts/sandbox/trunk/tiles/examples/simple/header-footer-sidebar-layout.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/header-footer-sidebar-layout.jsp?rev=190662&view=auto
==============================================================================
--- struts/sandbox/trunk/tiles/examples/simple/header-footer-sidebar-layout.jsp (added)
+++ struts/sandbox/trunk/tiles/examples/simple/header-footer-sidebar-layout.jsp Tue Jun 14 14:59:13 2005
@@ -0,0 +1,39 @@
+<%@ taglib uri="http://jakarta.apache.org/tiles"
+ prefix="tiles" %>
+
+ <%-- One table lays out all of the content for this attribute --%>
+ <table width='100%' height='100%'>
+ <tr>
+
+ <%-- Sidebar section --%>
+ <td width='150' valign='top' align='left'>
+ <tiles:insert attribute='sidebar'/>
+ </td>
+
+ <%-- Main content section --%>
+ <td height='100%' width='*'>
+ <table width='100%' height='100%'>
+ <tr>
+ <%-- Header section --%>
+ <td valign='top' height='15%'>
+ <tiles:insert attribute='header'/>
+ </td>
+ <tr>
+
+ <tr>
+ <%-- Content section --%>
+ <td valign='top' height='*'>
+ <tiles:insert attribute='content'/>
+ </td>
+ </tr>
+
+ <tr>
+ <%-- Footer section --%>
+ <td valign='bottom' height='15%'>
+ <tiles:insert attribute='footer'/>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
Added: struts/sandbox/trunk/tiles/examples/simple/header.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/header.jsp?rev=190662&view=auto
==============================================================================
--- struts/sandbox/trunk/tiles/examples/simple/header.jsp (added)
+++ struts/sandbox/trunk/tiles/examples/simple/header.jsp Tue Jun 14 14:59:13 2005
@@ -0,0 +1,2 @@
+<font size='6'>Tiles</font>
+<hr>
Added: struts/sandbox/trunk/tiles/examples/simple/login.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/login.jsp?rev=190662&view=auto
==============================================================================
--- struts/sandbox/trunk/tiles/examples/simple/login.jsp (added)
+++ struts/sandbox/trunk/tiles/examples/simple/login.jsp Tue Jun 14 14:59:13 2005
@@ -0,0 +1,12 @@
+<%@ taglib uri="http://jakarta.apache.org/tiles" prefix="tiles" %>
+
+<html>
+ <head>
+ <title>Login</title>
+ </head>
+
+ <body background="graphics/blueAndWhiteBackground.gif">
+ <tiles:insert definition="login-tile"/>
+ </body>
+</html>
+
Added: struts/sandbox/trunk/tiles/examples/simple/loginContent.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/loginContent.jsp?rev=190662&view=auto
==============================================================================
--- struts/sandbox/trunk/tiles/examples/simple/loginContent.jsp (added)
+++ struts/sandbox/trunk/tiles/examples/simple/loginContent.jsp Tue Jun 14 14:59:13 2005
@@ -0,0 +1,23 @@
+<font size='5'>Please log in</font>
+<p>
+<table>
+ <tr>
+ <td>
+ Name:
+ </td>
+ <td>
+ <input type="text"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Password
+ </td>
+ <td>
+ <input type="secret" size="8"/>
+ </td>
+ </tr>
+</table>
+<p>
+<input type="submit" value="Log in"/>
+
Added: struts/sandbox/trunk/tiles/examples/simple/preferences.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/preferences.jsp?rev=190662&view=auto
==============================================================================
--- struts/sandbox/trunk/tiles/examples/simple/preferences.jsp (added)
+++ struts/sandbox/trunk/tiles/examples/simple/preferences.jsp Tue Jun 14 14:59:13 2005
@@ -0,0 +1,12 @@
+<%@ taglib uri="http://jakarta.apache.org/tiles" prefix="tiles" %>
+
+<html>
+ <head>
+ <title>Preferences</title>
+ </head>
+
+ <body background="graphics/blueAndWhiteBackground.gif">
+ <tiles:insert definition="preferences-tile"/>
+ </body>
+</html>
+
Added: struts/sandbox/trunk/tiles/examples/simple/preferencesContent.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/preferencesContent.jsp?rev=190662&view=auto
==============================================================================
--- struts/sandbox/trunk/tiles/examples/simple/preferencesContent.jsp (added)
+++ struts/sandbox/trunk/tiles/examples/simple/preferencesContent.jsp Tue Jun 14 14:59:13 2005
@@ -0,0 +1,48 @@
+<font size='5'>Change your preferences</font>
+<p>
+<table>
+ <tr>
+ <td>
+ Standard font:
+ </td>
+ <td>
+ <input type="text" value="Arial 13"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Fixed-width font:
+ </td>
+ <td>
+ <input type="text" value="Helvetica 12"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Smallest allowable font size:
+ </td>
+ <td>
+ <input type="text" size="3" value="5"/>
+ <input type="submit" value="<"/>
+ <input type="submit" value=">"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Display images when page opens
+ </td>
+ <td>
+ <input type="checkbox"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Underline links
+ </td>
+ <td>
+ <input type="checkbox"/>
+ </td>
+ </tr>
+</table>
+<p>
+<input type="submit" value="Set preferences"/>
Added: struts/sandbox/trunk/tiles/examples/simple/sidebar.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/examples/simple/sidebar.jsp?rev=190662&view=auto
==============================================================================
--- struts/sandbox/trunk/tiles/examples/simple/sidebar.jsp (added)
+++ struts/sandbox/trunk/tiles/examples/simple/sidebar.jsp Tue Jun 14 14:59:13 2005
@@ -0,0 +1,31 @@
+<%@ page contentType='text/html; charset=UTF-8' %>
+<%@ taglib uri='http://java.sun.com/jstl/core' prefix='c' %>
+
+<table width='100%'>
+ <tr>
+ <%-- Sidebar top component --%>
+ <td width='150' height='50' valign='top' align='left'>
+ <a href=''><img src='graphics/flags/britain_flag.gif' style='border: 0px'/></a>
+ <a href=''><img src='graphics/flags/german_flag.gif' style='border: 0px'/></a>
+ <a href=''><img src='graphics/flags/chinese_flag.gif' style='border: 0px'/></a>
+ </td>
+ </tr>
+
+ <tr>
+ <%-- Sidebar bottom component --%>
+ <td>
+ <table>
+ <tr>
+ <td>
+ <font size='5'>Links</font><p>
+ <a href=''>Home</a><br>
+ <a href=''>Products</a><br>
+ <a href=''>Downloads</a><br>
+ <a href=''>White papers</a><br>
+ <a href=''>Contact us</a><br>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
Added: struts/sandbox/trunk/tiles/tiles.pdf
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/tiles/tiles.pdf?rev=190662&view=auto
==============================================================================
Binary file - no diff available.
Propchange: struts/sandbox/trunk/tiles/tiles.pdf
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org