You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by pr...@apache.org on 2005/10/31 20:41:57 UTC

svn commit: r329882 - in /myfaces/examples/trunk/sandbox: WEB-INF/examples-config.xml dateTimeConverter.jsp home.jsp src/java/org/apache/myfaces/examples/dateTimeConverter/ src/java/org/apache/myfaces/examples/dateTimeConverter/DateTimeConverterBean.java

Author: prophecy
Date: Mon Oct 31 11:41:55 2005
New Revision: 329882

URL: http://svn.apache.org/viewcvs?rev=329882&view=rev
Log:
New DateTimeConverter that will use TimeZone.getDefault instead of GMT

Added:
    myfaces/examples/trunk/sandbox/dateTimeConverter.jsp
    myfaces/examples/trunk/sandbox/src/java/org/apache/myfaces/examples/dateTimeConverter/
    myfaces/examples/trunk/sandbox/src/java/org/apache/myfaces/examples/dateTimeConverter/DateTimeConverterBean.java
Modified:
    myfaces/examples/trunk/sandbox/WEB-INF/examples-config.xml
    myfaces/examples/trunk/sandbox/home.jsp

Modified: myfaces/examples/trunk/sandbox/WEB-INF/examples-config.xml
URL: http://svn.apache.org/viewcvs/myfaces/examples/trunk/sandbox/WEB-INF/examples-config.xml?rev=329882&r1=329881&r2=329882&view=diff
==============================================================================
--- myfaces/examples/trunk/sandbox/WEB-INF/examples-config.xml (original)
+++ myfaces/examples/trunk/sandbox/WEB-INF/examples-config.xml Mon Oct 31 11:41:55 2005
@@ -390,8 +390,14 @@
 	</managed-bean>
 
 
+    <managed-bean>
+		<managed-bean-name>dateTimeConverterBean</managed-bean-name>
+		<managed-bean-class>org.apache.myfaces.examples.dateTimeConverter.DateTimeConverterBean</managed-bean-class>
+		<managed-bean-scope>session</managed-bean-scope>
+	</managed-bean>
 
-	<!-- navigational rules for the wizard -->
+
+    <!-- navigational rules for the wizard -->
 	<navigation-rule>
 		<from-view-id>/*</from-view-id>
 		<navigation-case>

Added: myfaces/examples/trunk/sandbox/dateTimeConverter.jsp
URL: http://svn.apache.org/viewcvs/myfaces/examples/trunk/sandbox/dateTimeConverter.jsp?rev=329882&view=auto
==============================================================================
--- myfaces/examples/trunk/sandbox/dateTimeConverter.jsp (added)
+++ myfaces/examples/trunk/sandbox/dateTimeConverter.jsp Mon Oct 31 11:41:55 2005
@@ -0,0 +1,63 @@
+<%@ page session="false" contentType="text/html;charset=utf-8" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
+<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s" %>
+
+<html>
+
+<%@ include file="inc/head.inc" %>
+
+<!--
+/*
+ * Copyright 2004 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.
+ */
+//-->
+
+<body>
+
+<f:view>
+
+    <h1>Sandbox DateTimeConverter</h1>
+    <h:form>
+        <h:panelGrid columns="3">
+            <h:outputText value="Sandbox DateTimeConverter:"/>
+            <h:inputText value="#{dateTimeConverterBean.date1}">
+                <s:convertDateTime pattern="yyyy-MM-dd HH:mm:ss"></s:convertDateTime>
+            </h:inputText>
+            <h:outputText value="#{dateTimeConverterBean.date1}">
+                <s:convertDateTime pattern="yyyy-MM-dd HH:mm:ss z"></s:convertDateTime>
+            </h:outputText>
+
+            <h:outputText value="Spec DateTimeConverter:"/>
+            <h:inputText value="#{dateTimeConverterBean.date2}">
+                <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss"/>
+            </h:inputText>
+            <h:outputText value="#{dateTimeConverterBean.date2}">
+                <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss z"/>
+            </h:outputText>
+        </h:panelGrid>
+        <h:commandButton action="#{dateTimeConverterBean.submit}" value="Submit"/>
+    </h:form>
+
+
+</f:view>
+
+<%@ include file="inc/page_footer.jsp" %>
+
+</body>
+
+</html>
+

Modified: myfaces/examples/trunk/sandbox/home.jsp
URL: http://svn.apache.org/viewcvs/myfaces/examples/trunk/sandbox/home.jsp?rev=329882&r1=329881&r2=329882&view=diff
==============================================================================
--- myfaces/examples/trunk/sandbox/home.jsp (original)
+++ myfaces/examples/trunk/sandbox/home.jsp Mon Oct 31 11:41:55 2005
@@ -29,6 +29,7 @@
             <h:outputLink value="effect.jsf" ><f:verbatim>Effect - FAT and script.aculo.us effects</f:verbatim></h:outputLink>
 			<h:commandLink action="go_scope_shop"><f:verbatim>Scope - saveState without serialisation</f:verbatim></h:commandLink>
 			<h:outputLink value="picklist.jsf"><f:verbatim>selectManyPicklist - a picklist</f:verbatim></h:outputLink>
+            <h:outputLink value="dateTimeConverter.jsf"><f:verbatim>DateTimeConverter - a datetime converter that uses system timezone as default</f:verbatim></h:outputLink>
         </h:panelGrid>
     </f:view>
 

Added: myfaces/examples/trunk/sandbox/src/java/org/apache/myfaces/examples/dateTimeConverter/DateTimeConverterBean.java
URL: http://svn.apache.org/viewcvs/myfaces/examples/trunk/sandbox/src/java/org/apache/myfaces/examples/dateTimeConverter/DateTimeConverterBean.java?rev=329882&view=auto
==============================================================================
--- myfaces/examples/trunk/sandbox/src/java/org/apache/myfaces/examples/dateTimeConverter/DateTimeConverterBean.java (added)
+++ myfaces/examples/trunk/sandbox/src/java/org/apache/myfaces/examples/dateTimeConverter/DateTimeConverterBean.java Mon Oct 31 11:41:55 2005
@@ -0,0 +1,44 @@
+package org.apache.myfaces.examples.dateTimeConverter;
+
+import java.util.Date;
+
+/**
+ * User: treeder
+ * Date: Oct 31, 2005
+ * Time: 9:05:17 AM
+ */
+public class DateTimeConverterBean
+{
+    private Date date1;
+    private Date date2;
+
+    public DateTimeConverterBean()
+    {
+        date1 = new Date();
+        date2 = new Date();
+    }
+
+    public Date getDate1()
+    {
+        return date1;
+    }
+
+    public void setDate1(Date date1)
+    {
+        this.date1 = date1;
+    }
+
+    public Date getDate2()
+    {
+        return date2;
+    }
+
+    public void setDate2(Date date2)
+    {
+        this.date2 = date2;
+    }
+    public String submit(){
+        // do nothing
+        return null;
+    }
+}