svn commit: r929448 - in /struts/struts2/trunk/core/src: main/java/org/apache/struts2/components/Date.java test/java/org/apache/struts2/views/jsp/ui/DateTagTest.java
Author: lukaszlenart Date: Wed Mar 31 09:53:00 2010 New Revision: 929448 URL: http://svn.apache.org/viewvc?rev=929448&view=rev Log: Resolved WW-3424 - added expression evaluation for timezone attribute Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Date.java struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DateTagTest.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Date.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Date.java?rev=929448&r1=929447&r2=929448&view=diff == --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Date.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Date.java Wed Mar 31 09:53:00 2010 @@ -302,11 +302,7 @@ public class Date extends ContextBean { if (nice) { msg = formatTime(tp, date); } else { -TimeZone tz = TimeZone.getDefault(); -if (timezone != null) { -tz = TimeZone.getTimeZone(timezone); -} - +TimeZone tz = getTimeZone(); if (format == null) { String globalFormat = null; @@ -353,6 +349,19 @@ public class Date extends ContextBean { return super.end(writer, ""); } +private TimeZone getTimeZone() { +TimeZone tz = TimeZone.getDefault(); +if (timezone != null) { +timezone = stripExpressionIfAltSyntax(timezone); +String actualTimezone = (String) getStack().findValue(timezone, String.class); +if (actualTimezone != null) { +timezone = actualTimezone; +} +tz = TimeZone.getTimeZone(timezone); +} +return tz; +} + @StrutsTagAttribute(description="Date or DateTime format pattern", rtexprvalue=false) public void setFormat(String format) { this.format = format; Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DateTagTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DateTagTest.java?rev=929448&r1=929447&r2=929448&view=diff == --- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DateTagTest.java (original) +++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/DateTagTest.java Wed Mar 31 09:53:00 2010 @@ -70,6 +70,24 @@ public class DateTagTest extends Abstrac assertEquals(formatted, writer.toString()); } +public void testCustomFormatWithTimezoneAsExpression() throws Exception { +String format = "/MM/dd hh:mm:ss"; +Date now = Calendar.getInstance(TimeZone.getTimeZone("UTC+2")).getTime(); +SimpleDateFormat sdf = new SimpleDateFormat(format); +sdf.setTimeZone(TimeZone.getTimeZone("UTC+2")); +String formatted = sdf.format(now); +context.put("myDate", now); +context.put("myTimezone", "UTC+2"); + +tag.setName("myDate"); +tag.setNice(false); +tag.setFormat(format); +tag.setTimezone("myTimezone"); +tag.doStartTag(); +tag.doEndTag(); +assertEquals(formatted, writer.toString()); +} + public void testCustomFormatCalendar() throws Exception { String format = "/MM/dd hh:mm:ss"; Calendar calendar = Calendar.getInstance();
[OSS Bamboo] Struts 2 SVN - Main Build build 1294 has FAILED (0 tests failed). Change made by Lukasz Lenart
--- STRUTS-MAIN-1294 failed. --- Code has been updated by Lukasz Lenart. No failed tests found, a possible compilation error. http://opensource.bamboo.atlassian.com/browse/STRUTS-MAIN-1294/ -- Code Changes -- Lukasz Lenart (929448): >Resolved WW-3424 - added expression evaluation for timezone attribute -- Error Summary -- [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] Compilation failure Failure executing javac, but could not parse the error: The system is out of resources. Consult the following stack trace for details. java.lang.OutOfMemoryError: PermGen space at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at org.codehaus.plexus.compiler.javac.IsolatedClassLoader.loadClass(IsolatedClassLoader.java:56) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at com.sun.tools.javac.main.JavaCompiler.(JavaCompiler.java:317) at com.sun.tools.javac.main.JavaCompiler.instance(JavaCompiler.java:72) at com.sun.tools.javac.main.Main.compile(Main.java:340) at com.sun.tools.javac.main.Main.compile(Main.java:279) at com.sun.tools.javac.main.Main.compile(Main.java:270) at com.sun.tools.javac.Main.compile(Main.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:420) at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:141) at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:493) at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356) [INFO] [INFO] For more information, run Maven with the -e switch -- This message is automatically generated by Atlassian Bamboo
[CONF] Confluence Changes in the last 24 hours
This is a daily summary of all recent changes in Confluence. - Updated Spaces: - Apache ActiveMQ (http://cwiki.apache.org/confluence/display/ACTIVEMQ) Pages - TCP Transport Reference edited by rajdavies (12:53 PM) http://cwiki.apache.org/confluence/display/ACTIVEMQ/TCP+Transport+Reference Web Console edited by dejanb (08:00 AM) http://cwiki.apache.org/confluence/display/ACTIVEMQ/Web+Console Apache Aries (http://cwiki.apache.org/confluence/display/ARIES) Pages - Release proposal edited by hughesj (01:06 PM) http://cwiki.apache.org/confluence/display/ARIES/Release+proposal Apache Camel (http://cwiki.apache.org/confluence/display/CAMEL) Pages - Netty created by akarpe (09:51 PM) http://cwiki.apache.org/confluence/display/CAMEL/Netty GAE edited by mrt1nz (03:00 PM) http://cwiki.apache.org/confluence/display/CAMEL/GAE How to remove the http protocol headers in the camel message? created by njiang (09:48 AM) http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=14814428 JCR edited by davsclaus (07:25 AM) http://cwiki.apache.org/confluence/display/CAMEL/JCR Camel 2.3.0 Release edited by njiang (06:24 AM) http://cwiki.apache.org/confluence/display/CAMEL/Camel+2.3.0+Release Apache Chemistry (http://cwiki.apache.org/confluence/display/CMIS) Pages - Chemistry and OpenCMIS Technical Comparison edited by fmui (12:01 PM) http://cwiki.apache.org/confluence/display/CMIS/Chemistry+and+OpenCMIS+Technical+Comparison F2F Meeting April 2010 edited by unc...@apache.org (10:42 AM) http://cwiki.apache.org/confluence/display/CMIS/F2F+Meeting+April+2010 Apache CXF (http://cwiki.apache.org/confluence/display/CXF) Pages - Resources and Articles edited by mazzag (12:00 AM) http://cwiki.apache.org/confluence/display/CXF/Resources+and+Articles Apache Felix (http://cwiki.apache.org/confluence/display/FELIX) Pages - Board Reports edited by he...@ungoverned.org (03:58 PM) http://cwiki.apache.org/confluence/display/FELIX/Board+Reports Board Report (2010-06) created by fmeschbe (03:35 PM) http://cwiki.apache.org/confluence/display/FELIX/Board+Report+%282010-06%29 news edited by fmeschbe (03:32 PM) http://cwiki.apache.org/confluence/display/FELIX/news downloads edited by fmeschbe (03:04 PM) http://cwiki.apache.org/confluence/display/FELIX/downloads Apache Geronimo Project Management (http://cwiki.apache.org/confluence/display/GMOxPMGT) Pages - Geronimo Release Process edited by rwonly (01:50 AM) http://cwiki.apache.org/confluence/display/GMOxPMGT/Geronimo+Release+Process Apache Lucene Mahout (http://cwiki.apache.org/confluence/display/MAHOUT) Pages - GSOC created by gsingers (12:51 PM) http://cwiki.apache.org/confluence/display/MAHOUT/GSOC index edited by gsingers (12:31 PM) http://cwiki.apache.org/confluence/display/MAHOUT/index Apache Maven (http://cwiki.apache.org/confluence/display/MAVEN) Pages - Maven 3.x and site plugin edited by olamy (08:17 PM) http://cwiki.apache.org/confluence/display/MAVEN/Maven+3.x+and+site+plugin OFBiz Technical Documentation (http://cwiki.apache.org/confluence/display/OFBTECH) Pages - Revisions Requiring Data Migration edited by jacques.le.roux (10:00 PM) http://cwiki.apache.org/confluence/display/OFBTECH/Revisions+Requiring+Data+Migration Traffic Server (http://cwiki.apache.org/confluence/display/TS) Pages - Apache Traffic Server AMIs for EC2 edited by jason.giedy...@gmail.com (11:58 PM) http://cwiki.apache.org/confluence/display/TS/Apache+Traffic+Server+AMIs+for+EC2 Traffic Server edited by jason.giedy...@gmail.com (11:23 PM) http://cwiki.apache.org/confluence/display/TS/Traffic+Server Git edited by andrew...@apache.org (10:06 PM) http://cwiki.apache.org/confluence/display/TS/Git Projects edited by mlibbey (07:16 PM) http://cwiki.apache.org/confluence/display/TS/Projects Apache Wink (http://cwiki.apache.org/confluence/display/WINK) Pages - Mapping RSS into Syndication Object Model edited by shivakumar (10:27 AM) http://cwiki.apache.org/confluence/display/WINK/Ma