[jira] [Commented] (TAP5-2364) beta15 breaks Google App Engine & other Production environments

2014-08-01 Thread Jochen Kemnade (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082000#comment-14082000
 ] 

Jochen Kemnade commented on TAP5-2364:
--

Do you get an error message or a stack trace?
What exactly causes the problem? The {{new File(cacheDir)}}? We could just move 
that into the {{if (!productionMode)}} block then, along with the {{mkdirs()}}.

> beta15 breaks Google App Engine & other Production environments
> ---
>
> Key: TAP5-2364
> URL: https://issues.apache.org/jira/browse/TAP5-2364
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-webresources
>Affects Versions: 5.4
>Reporter: Jonathan Williams
>
> beta15 breaks GAE & some other prod environments
> I have a couple of app engine apps that are broken w/ beta15
> This is due to use of java.io.File to mkdir, which is prohibited on app 
> engine and is more generally considered a JEE no-no.
> ...
> ResourceTransformerFactoryImpl creates a File for the asset cache directory.
> This breaks my app in GAE, since creating a new File is prohibited.
> ...
> it looks like the cache is only used in development
> mode but still references File in production (thus breaking GAE). Perhaps a
> proper fix will involve a pluggable cache which does nothing in production
> mode.
> As a workaround you can override the ResourceTransformerFactory via ioc
> with an implementation that doesn't reference java.io.File. Most likely a
> copy/paste/tweak of the current version.
> ...
> Note, this could also break non GAE environments since it calls mkdirs() on
> @Symbol(WebResourcesSymbols.CACHE_DIR). For example a unix server without
> write permission.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-2364) beta15 breaks Google App Engine & other Production environments

2014-08-01 Thread Jonathan Williams (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082314#comment-14082314
 ] 

Jonathan Williams commented on TAP5-2364:
-

Caused by: java.lang.RuntimeException: Exception invoking method public void 
org.apache.tapestry5.internal.webresources.ResourceTransformerFactoryImpl.createCacheDir():
 access denied ("java.io.FilePermission" "images/tapestry-asset-cache" "write")
at 
org.apache.tapestry5.ioc.internal.util.InternalUtils$26$1.initialize(InternalUtils.java:1691)
at 
org.apache.tapestry5.ioc.internal.util.ConstructionPlan$1.run(ConstructionPlan.java:80)
at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:56)
... 216 more
Caused by: java.security.AccessControlException: access denied 
("java.io.FilePermission" "images/tapestry-asset-cache" "write")
at 
java.security.AccessControlContext.checkPermission(AccessControlContext.java:375)
at 
java.security.AccessController.checkPermission(AccessController.java:565)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkWrite(SecurityManager.java:979)
at java.io.File.mkdir(File.java:1314)
at java.io.File.mkdirs(File.java:1343)
at 
org.apache.tapestry5.internal.webresources.ResourceTransformerFactoryImpl.createCacheDir(ResourceTransformerFactoryImpl.java:65)

> beta15 breaks Google App Engine & other Production environments
> ---
>
> Key: TAP5-2364
> URL: https://issues.apache.org/jira/browse/TAP5-2364
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-webresources
>Affects Versions: 5.4
>Reporter: Jonathan Williams
>
> beta15 breaks GAE & some other prod environments
> I have a couple of app engine apps that are broken w/ beta15
> This is due to use of java.io.File to mkdir, which is prohibited on app 
> engine and is more generally considered a JEE no-no.
> ...
> ResourceTransformerFactoryImpl creates a File for the asset cache directory.
> This breaks my app in GAE, since creating a new File is prohibited.
> ...
> it looks like the cache is only used in development
> mode but still references File in production (thus breaking GAE). Perhaps a
> proper fix will involve a pluggable cache which does nothing in production
> mode.
> As a workaround you can override the ResourceTransformerFactory via ioc
> with an implementation that doesn't reference java.io.File. Most likely a
> copy/paste/tweak of the current version.
> ...
> Note, this could also break non GAE environments since it calls mkdirs() on
> @Symbol(WebResourcesSymbols.CACHE_DIR). For example a unix server without
> write permission.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Assigned] (TAP5-2364) beta15 breaks Google App Engine & other Production environments

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship reassigned TAP5-2364:
--

Assignee: Howard M. Lewis Ship

> beta15 breaks Google App Engine & other Production environments
> ---
>
> Key: TAP5-2364
> URL: https://issues.apache.org/jira/browse/TAP5-2364
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-webresources
>Affects Versions: 5.4
>Reporter: Jonathan Williams
>Assignee: Howard M. Lewis Ship
>
> beta15 breaks GAE & some other prod environments
> I have a couple of app engine apps that are broken w/ beta15
> This is due to use of java.io.File to mkdir, which is prohibited on app 
> engine and is more generally considered a JEE no-no.
> ...
> ResourceTransformerFactoryImpl creates a File for the asset cache directory.
> This breaks my app in GAE, since creating a new File is prohibited.
> ...
> it looks like the cache is only used in development
> mode but still references File in production (thus breaking GAE). Perhaps a
> proper fix will involve a pluggable cache which does nothing in production
> mode.
> As a workaround you can override the ResourceTransformerFactory via ioc
> with an implementation that doesn't reference java.io.File. Most likely a
> copy/paste/tweak of the current version.
> ...
> Note, this could also break non GAE environments since it calls mkdirs() on
> @Symbol(WebResourcesSymbols.CACHE_DIR). For example a unix server without
> write permission.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: TAP5-2364: Tapestry can use prohibited operations in some environments, such as Google App Engine

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master b25c8cde5 -> 7345bfb29


TAP5-2364: Tapestry can use prohibited operations in some environments, such as 
Google App Engine


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/7345bfb2
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/7345bfb2
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/7345bfb2

Branch: refs/heads/master
Commit: 7345bfb29bbb995209fcfb9f98f365b1cb643f68
Parents: b25c8cd
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 08:46:08 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 08:46:08 2014 -0700

--
 .../org/apache/tapestry5/SymbolConstants.java   |  7 +++
 .../exceptions/ExceptionReporterImpl.java   | 20 +---
 .../tapestry5/modules/TapestryModule.java   |  8 +---
 .../ResourceTransformerFactoryImpl.java |  9 +
 4 files changed, 34 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7345bfb2/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java 
b/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java
index 4ed67a8..bef3df4 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java
@@ -520,4 +520,11 @@ public class SymbolConstants
  */
 public static final String ENABLE_HTML5_SUPPORT = 
"tapestry.enable-html5-support";
 
+/**
+ * A general switch for restrictive environments, such as Google App 
Engine, which forbid some useful operations,
+ * such as creating files or directories. Defaults to false.
+ *
+ * @since 5.4
+ */
+public static final String RESTRICTIVE_ENVIRONMENT = 
"tapestry.restrictive-environment";
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7345bfb2/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
index 6a9bfad..3d0ab83 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
@@ -69,6 +69,10 @@ public class ExceptionReporterImpl implements 
ExceptionReporter
 private String contextPath;
 
 @Inject
+@Symbol(SymbolConstants.RESTRICTIVE_ENVIRONMENT)
+private boolean restrictive;
+
+@Inject
 private ExceptionAnalyzer analyzer;
 
 private final AtomicInteger uid = new AtomicInteger();
@@ -83,15 +87,25 @@ public class ExceptionReporterImpl implements 
ExceptionReporter
 public void reportException(Throwable exception)
 {
 Date date = new Date();
-String folderName = String.format("%tY-%http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7345bfb2/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java 
b/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java
index de06610..2d852a9 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java
@@ -2128,15 +2128,17 @@ public final class TapestryModule
 configuration.add(SymbolConstants.FORM_FIELD_CSS_CLASS, 
"form-control");
 
 // TAP5-1998
-configuration.add(SymbolConstants.LENIENT_DATE_FORMAT, "false");
+configuration.add(SymbolConstants.LENIENT_DATE_FORMAT, false);
 
 // TAP5-2187
-configuration.add(SymbolConstants.STRICT_CSS_URL_REWRITING, "false");
+configuration.add(SymbolConstants.STRICT_CSS_URL_REWRITING, false);
 
 configuration.add(SymbolConstants.EXCEPTION_REPORTS_DIR, 
"build/exceptions");
 
 // TAP5-1815
-configuration.add(SymbolConstants.ENABLE_HTML5_SUPPORT, "false");
+configuration.add(SymbolConstants.ENABLE_HTML5_SUPPORT, false);
+
+configuration.add(SymbolConstants.RESTRICTIVE_ENVIRONMENT, false);
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7345bfb2/tapes

[jira] [Commented] (TAP5-2364) Tapestry can use prohibited operations in some environments, such as Google App Engine

2014-08-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082371#comment-14082371
 ] 

ASF subversion and git services commented on TAP5-2364:
---

Commit 7345bfb29bbb995209fcfb9f98f365b1cb643f68 in tapestry-5's branch 
refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=7345bfb ]

TAP5-2364: Tapestry can use prohibited operations in some environments, such as 
Google App Engine


> Tapestry can use prohibited operations in some environments, such as Google 
> App Engine
> --
>
> Key: TAP5-2364
> URL: https://issues.apache.org/jira/browse/TAP5-2364
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-webresources
>Affects Versions: 5.4
>Reporter: Jonathan Williams
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
>
> beta15 breaks GAE & some other prod environments
> I have a couple of app engine apps that are broken w/ beta15
> This is due to use of java.io.File to mkdir, which is prohibited on app 
> engine and is more generally considered a JEE no-no.
> ...
> ResourceTransformerFactoryImpl creates a File for the asset cache directory.
> This breaks my app in GAE, since creating a new File is prohibited.
> ...
> it looks like the cache is only used in development
> mode but still references File in production (thus breaking GAE). Perhaps a
> proper fix will involve a pluggable cache which does nothing in production
> mode.
> As a workaround you can override the ResourceTransformerFactory via ioc
> with an implementation that doesn't reference java.io.File. Most likely a
> copy/paste/tweak of the current version.
> ...
> Note, this could also break non GAE environments since it calls mkdirs() on
> @Symbol(WebResourcesSymbols.CACHE_DIR). For example a unix server without
> write permission.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-2364) Tapestry can use prohibited operations in some environments, such as Google App Engine

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2364.
--

   Resolution: Fixed
Fix Version/s: 5.4

> Tapestry can use prohibited operations in some environments, such as Google 
> App Engine
> --
>
> Key: TAP5-2364
> URL: https://issues.apache.org/jira/browse/TAP5-2364
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-webresources
>Affects Versions: 5.4
>Reporter: Jonathan Williams
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
>
> beta15 breaks GAE & some other prod environments
> I have a couple of app engine apps that are broken w/ beta15
> This is due to use of java.io.File to mkdir, which is prohibited on app 
> engine and is more generally considered a JEE no-no.
> ...
> ResourceTransformerFactoryImpl creates a File for the asset cache directory.
> This breaks my app in GAE, since creating a new File is prohibited.
> ...
> it looks like the cache is only used in development
> mode but still references File in production (thus breaking GAE). Perhaps a
> proper fix will involve a pluggable cache which does nothing in production
> mode.
> As a workaround you can override the ResourceTransformerFactory via ioc
> with an implementation that doesn't reference java.io.File. Most likely a
> copy/paste/tweak of the current version.
> ...
> Note, this could also break non GAE environments since it calls mkdirs() on
> @Symbol(WebResourcesSymbols.CACHE_DIR). For example a unix server without
> write permission.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-2364) Tapestry can use prohibited operations in some environments, such as Google App Engine

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-2364:
---

Summary: Tapestry can use prohibited operations in some environments, such 
as Google App Engine  (was: beta15 breaks Google App Engine & other Production 
environments)

> Tapestry can use prohibited operations in some environments, such as Google 
> App Engine
> --
>
> Key: TAP5-2364
> URL: https://issues.apache.org/jira/browse/TAP5-2364
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-webresources
>Affects Versions: 5.4
>Reporter: Jonathan Williams
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
>
> beta15 breaks GAE & some other prod environments
> I have a couple of app engine apps that are broken w/ beta15
> This is due to use of java.io.File to mkdir, which is prohibited on app 
> engine and is more generally considered a JEE no-no.
> ...
> ResourceTransformerFactoryImpl creates a File for the asset cache directory.
> This breaks my app in GAE, since creating a new File is prohibited.
> ...
> it looks like the cache is only used in development
> mode but still references File in production (thus breaking GAE). Perhaps a
> proper fix will involve a pluggable cache which does nothing in production
> mode.
> As a workaround you can override the ResourceTransformerFactory via ioc
> with an implementation that doesn't reference java.io.File. Most likely a
> copy/paste/tweak of the current version.
> ...
> Note, this could also break non GAE environments since it calls mkdirs() on
> @Symbol(WebResourcesSymbols.CACHE_DIR). For example a unix server without
> write permission.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-1481) In production mode, component event requests that reference an unknown component should respond with a 404

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-1481:
---

Summary: In production mode, component event requests that reference an 
unknown component should respond with a 404  (was: ComponentPageElementImpl to 
throw a special exception when a component cannot be found by id)

> In production mode, component event requests that reference an unknown 
> component should respond with a 404
> --
>
> Key: TAP5-1481
> URL: https://issues.apache.org/jira/browse/TAP5-1481
> Project: Tapestry 5
>  Issue Type: Improvement
>  Components: tapestry-core
>Affects Versions: 5.2
>Reporter: Anton Litvinenko
>Assignee: Howard M. Lewis Ship
>
> when an embedded component cannot be found by id, then 
> ComponentPageElementImpl throws a TapestryException at line 841 for 5.1.0.5 
> (UnknownValueException for 5.2.4).
> I suggest throwing a special kind of exception in such case (e.g. 
> EmbeddedComponentNotFoundException or ComponentNotFoundException), so that 
> application would be able to handle such cases separately (e.g. by serving a 
> 404 error page).
> Particular use-case: google indexing bot cached a tapestry page and tries 
> indexing links that are included on this page. If links are actionlinks, then 
> they include id of the component. When one changes the id of the component 
> (or renames the component), then the "old" link doesn't work anymore as it 
> contains old id of the component -> google indexing bot is served with 
> Tapestry error page (which is a typical page). Instead, it makes sense to 
> send a 404 error as result and let google bot know that there is no such 
> resource anymore. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: TAP5-1481: In production mode, component event requests that reference an unknown component should respond with a 404

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master 7345bfb29 -> d9b3813a0


TAP5-1481: In production mode, component event requests that reference an 
unknown component should respond with a 404


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/d9b3813a
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/d9b3813a
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/d9b3813a

Branch: refs/heads/master
Commit: d9b3813a09c0d685b28b36192f578b01744af725
Parents: 7345bfb
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 10:11:11 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 10:11:11 2014 -0700

--
 .../tapestry5/internal/InternalConstants.java   | 12 
 .../services/ComponentEventDispatcher.java  | 11 +++-
 .../ComponentEventRequestHandlerImpl.java   |  2 -
 .../internal/services/PageRenderDispatcher.java | 11 +++-
 .../ProductionModeUnknownComponentFilter.java   | 64 
 .../tapestry5/internal/structure/Page.java  |  3 +-
 .../tapestry5/modules/TapestryModule.java   | 58 ++
 tapestry-core/src/test/conf/testng.xml  |  2 +-
 .../integration/app5/ProductionModeTests.groovy | 23 +++
 .../integration/app5/services/AppModule.groovy  |  2 +-
 .../services/ComponentEventDispatcherTest.java  | 10 ++-
 11 files changed, 162 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d9b3813a/tapestry-core/src/main/java/org/apache/tapestry5/internal/InternalConstants.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/InternalConstants.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/InternalConstants.java
index c069f11..7fa95e9 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/InternalConstants.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/InternalConstants.java
@@ -186,4 +186,16 @@ public final class InternalConstants
  * @since 5.4
  */
 public static final String SUPPRESS_CORE_STYLESHEETS = 
"tapestry.suppress-core-stylesheets";
+
+/**
+ * A bit of a hack that allows, in production mode, for a component event 
request to "unwind" when
+ * the component referenced in the URL does not exist. This is related to 
TAP5-1481. This situation
+ * can most likely occur when a web spider, such as Google, uses an old 
component event URI from
+ * a prior deployment, which no longer works in a new deployment, due to 
structural changes. Since
+ * changing the APIs that significantly is forbidden, a non-null value is 
added as an
+ * {@link org.apache.tapestry5.services.Request} attribute.
+ *
+ * @since 5.4
+ */
+public static final String REFERENCED_COMPONENT_NOT_FOUND = 
"tapestry.referenced-component-not-found";
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d9b3813a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentEventDispatcher.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentEventDispatcher.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentEventDispatcher.java
index ef16591..1d0bd5d 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentEventDispatcher.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentEventDispatcher.java
@@ -1,5 +1,3 @@
-// Copyright 2006, 2007, 2008, 2009 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
@@ -14,6 +12,7 @@
 
 package org.apache.tapestry5.internal.services;
 
+import org.apache.tapestry5.internal.InternalConstants;
 import org.apache.tapestry5.services.*;
 
 import java.io.IOException;
@@ -43,8 +42,16 @@ public class ComponentEventDispatcher implements Dispatcher
 
 if (parameters == null) return false;
 
+// Inside this pipeline, may find that the component id does not exist 
(this check only occurs in production
+// mode) ...
+
 componentRequestHandler.handleComponentEvent(parameters);
 
+// ... in which case, this attribute is set.
+if 
(request.getAttribute(InternalConstants.REFERENCED_COMPONENT_NOT_FOUND) != 
null) {
+return false;
+}
+
 return true;
 }
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d9b3813a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentEventRequestHandlerImpl.ja

[jira] [Closed] (TAP5-1481) In production mode, component event requests that reference an unknown component should respond with a 404

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-1481.
--

   Resolution: Fixed
Fix Version/s: 5.4

> In production mode, component event requests that reference an unknown 
> component should respond with a 404
> --
>
> Key: TAP5-1481
> URL: https://issues.apache.org/jira/browse/TAP5-1481
> Project: Tapestry 5
>  Issue Type: Improvement
>  Components: tapestry-core
>Affects Versions: 5.2
>Reporter: Anton Litvinenko
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
>
> when an embedded component cannot be found by id, then 
> ComponentPageElementImpl throws a TapestryException at line 841 for 5.1.0.5 
> (UnknownValueException for 5.2.4).
> I suggest throwing a special kind of exception in such case (e.g. 
> EmbeddedComponentNotFoundException or ComponentNotFoundException), so that 
> application would be able to handle such cases separately (e.g. by serving a 
> 404 error page).
> Particular use-case: google indexing bot cached a tapestry page and tries 
> indexing links that are included on this page. If links are actionlinks, then 
> they include id of the component. When one changes the id of the component 
> (or renames the component), then the "old" link doesn't work anymore as it 
> contains old id of the component -> google indexing bot is served with 
> Tapestry error page (which is a typical page). Instead, it makes sense to 
> send a 404 error as result and let google bot know that there is no such 
> resource anymore. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-1481) In production mode, component event requests that reference an unknown component should respond with a 404

2014-08-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-1481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082524#comment-14082524
 ] 

ASF subversion and git services commented on TAP5-1481:
---

Commit d9b3813a09c0d685b28b36192f578b01744af725 in tapestry-5's branch 
refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=d9b3813 ]

TAP5-1481: In production mode, component event requests that reference an 
unknown component should respond with a 404


> In production mode, component event requests that reference an unknown 
> component should respond with a 404
> --
>
> Key: TAP5-1481
> URL: https://issues.apache.org/jira/browse/TAP5-1481
> Project: Tapestry 5
>  Issue Type: Improvement
>  Components: tapestry-core
>Affects Versions: 5.2
>Reporter: Anton Litvinenko
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
>
> when an embedded component cannot be found by id, then 
> ComponentPageElementImpl throws a TapestryException at line 841 for 5.1.0.5 
> (UnknownValueException for 5.2.4).
> I suggest throwing a special kind of exception in such case (e.g. 
> EmbeddedComponentNotFoundException or ComponentNotFoundException), so that 
> application would be able to handle such cases separately (e.g. by serving a 
> 404 error page).
> Particular use-case: google indexing bot cached a tapestry page and tries 
> indexing links that are included on this page. If links are actionlinks, then 
> they include id of the component. When one changes the id of the component 
> (or renames the component), then the "old" link doesn't work anymore as it 
> contains old id of the component -> google indexing bot is served with 
> Tapestry error page (which is a typical page). Instead, it makes sense to 
> send a 404 error as result and let google bot know that there is no such 
> resource anymore. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-1803) URL encoding in ActivationRequestParameter is very strict

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-1803:
---

Assignee: (was: Howard M. Lewis Ship)

> URL encoding in ActivationRequestParameter is very strict
> -
>
> Key: TAP5-1803
> URL: https://issues.apache.org/jira/browse/TAP5-1803
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.1
>Reporter: David Canteros
>  Labels: @ActivationRequestParameter, InvalidaArgumenteException, 
> URLEncoder,
>
> The URLEncoder that perform the URL encoding process does not include the 
> following "unreserved characters" :  
>  !  ~  *  ' (  )   
> (see rfc2396 Uniform Resource Identifiers (URI): Generic Syntax, item 2.3)
>
> Because the fix of TAP5-1768, from v5.3.1 the @ActivationRequestParameter 
> requires this enconding, which becomes incompatible with the standard.
> Thus, any URL which contains those symbols will throw an 
> InvalidaArgumenteException. Tapestry should consider that the 
> ActivationRequestParameter is a standar way of parameter sending, and the 
> parameters sent in this way probably not have the "strict" coding process of 
> the URLEncoder.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-1835) Stripping of package names from logical page name may not occur in intuitive order

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-1835:
---

Assignee: (was: Howard M. Lewis Ship)

> Stripping of package names from logical page name may not occur in intuitive 
> order
> --
>
> Key: TAP5-1835
> URL: https://issues.apache.org/jira/browse/TAP5-1835
> Project: Tapestry 5
>  Issue Type: Improvement
>  Components: tapestry-core
>Affects Versions: 5.2.5
>Reporter: Vladimir Velikiy
> Attachments: terms_strip_order.diff
>
>
> I have page in library with prefix requests. Its logical path is: 
> requests/requeststatus/RequestStatusView. After stripping logical page name 
> by ComponentClassResolver I see the following result: 
> requests/requeststatus/tatusView. This is because the terms of the path 
> prefix are processed in direct order: requests, requeststatus. It would be 
> more correct way to handle the terms in reverse order: requeststatus, 
> request, which will give more correct result: requests/requeststatus/View. 
> The last term in the path prefix has a close value to the name of the page 
> than the previous.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-1804) Tree component does not support selecting folders, just leaves

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-1804:
---

Assignee: (was: Howard M. Lewis Ship)

> Tree component does not support selecting folders, just leaves
> --
>
> Key: TAP5-1804
> URL: https://issues.apache.org/jira/browse/TAP5-1804
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3, 5.4
>Reporter: Howard M. Lewis Ship
>  Labels: tree
>
> I'd really like to use the Tree component in an application, but it currently 
> only allows leaves to be selected, not folders.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-2016) Scala style properties unnecessarily require a field with the same name

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-2016:
---

Assignee: (was: Howard M. Lewis Ship)

> Scala style properties unnecessarily require a field with the same name
> ---
>
> Key: TAP5-2016
> URL: https://issues.apache.org/jira/browse/TAP5-2016
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-ioc
>Affects Versions: 5.3.6, 5.2.5
>Reporter: Henning Petersen
>  Labels: patch, scala
> Attachments: TAP5-2016.patch
>
>
> The changes introduced with TAP5-1064 allow Scala-style properties to be used 
> from components without the need for Java-style getters and setters. The 
> implementation currently requires a field of the same name as the property to 
> exist on the bean, which is unfortunate. 
> This works:
> var value: String = _
> 
> This does not:
> def value(): String = ...
> def value_=(value: String) { ... }
> 
> A class which delegates property access to a backing bean is not recognized 
> by PropertyAccessImpl as having any valid properties; the same is the case 
> when the field has a different name than the property. 
> Possible workarounds include a dead field in the value class to satisfy the 
> condition in PropertyAccessImpl, and adding Java-style getters and setters 
> for the property.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-2100) ZoneRefresh mixin triggers refresh event with wrong context

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-2100:
---

Assignee: (was: Howard M. Lewis Ship)

> ZoneRefresh mixin triggers refresh event with wrong context
> ---
>
> Key: TAP5-2100
> URL: https://issues.apache.org/jira/browse/TAP5-2100
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6
>Reporter: Ivan Khalopik
>  Labels: patch
> Attachments: 
> 0001-TAP5-2100-ZoneRefresh-mixin-triggers-refresh-event-w.patch
>
>
> ZoneRefresh mixin triggers refresh event with context populated from 
> parameter instead of context from event link. 
> Before render script it creates event link with context:
>private Object createEventLink()
>{
>   Link link = resources.createEventLink("zoneRefresh", context);
>   return link.toAbsoluteURI();
>}
>
> But then it uses context parameter instead of context from event link:
>Object onZoneRefresh()
>{
>   CaptureResultCallback callback = new 
> CaptureResultCallback();
>   resources.triggerEvent(EventConstants.REFRESH, context, callback);
>   
>   if(callback.getResult() != null){
>  return callback.getResult();
>   }
>   
>   return zone.getBody();
>}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-1900) Tapestry always uses application charset for request encoding, should first check content-type header

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-1900:
---

Assignee: (was: Howard M. Lewis Ship)

> Tapestry always uses application charset for request encoding, should first 
> check content-type header
> -
>
> Key: TAP5-1900
> URL: https://issues.apache.org/jira/browse/TAP5-1900
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5, 5.3.6
>Reporter: Nelson Rodrigues
> Attachments: tap5-1900.patch
>
>
> I'm using Tapestry as a sort of REST server, using pages to act as REST 
> gateways to business services.
> To access those pages I'm using Spring's RestTemplate which as a default uses 
> ISO-8859-1 as the request encoding and properly seting the request's 
> content-type header.
> Tapestry currently forces the request encoding to be the same as the 
> application charset (see 
> org.apache.tapestry5.internal.services.RequestImpl.setupEncoding), I believe 
> it should first check the content-type header and use that value instead, 
> only using application charset as a fallback.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Assigned] (TAP5-1947) BigDecimal Validator

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship reassigned TAP5-1947:
--

Assignee: (was: Howard M. Lewis Ship)

> BigDecimal Validator
> 
>
> Key: TAP5-1947
> URL: https://issues.apache.org/jira/browse/TAP5-1947
> Project: Tapestry 5
>  Issue Type: Improvement
>  Components: tapestry-core
>Affects Versions: 5.3.3
>Reporter: George Christman
>  Labels: features
>
> Tapestry should offer the ability to validate BigDecimal max length's for 
> currency/amounts. I'm donating the following code which validates maxScale 
> and maxPrecision. Unfortunately, I haven't written anything to handle the 
> clientside validation. 
> //app.properties
> maximum-precision=You may provide at most %d numbers for %s.
> maximum-scale=You may provide at most %d decimal digits for %s.
> //MaxScale
> public class MaxScale extends AbstractValidator {
> public MaxScale() {
> super(Integer.class, BigDecimal.class, "maximum-scale");
> }
> @Override
> public void validate(Field field, Integer constraintValue, 
> MessageFormatter formatter, BigDecimal value)
> throws ValidationException
> {
> if (value.scale() > constraintValue)
> throw new ValidationException(buildMessage(formatter, field, 
> constraintValue));
> }
> private String buildMessage(MessageFormatter formatter, Field field, 
> Integer constraintValue) {
> return formatter.format(constraintValue, field.getLabel());
> }
>
> @Override
> public void render(Field field, Integer constraintValue, MessageFormatter 
> formatter, MarkupWriter writer,
> FormSupport formSupport) {
> formSupport.addValidation(field, "maxscale", buildMessage(formatter, 
> field, constraintValue), constraintValue);
> }
> }
> //MaxPrecision
> public class MaxPrecision extends AbstractValidator {
> public MaxPrecision() {
> super(Integer.class, BigDecimal.class, "maximum-precision");
> }
> @Override
> public void validate(Field field, Integer constraintValue, 
> MessageFormatter formatter, BigDecimal value)
> throws ValidationException
> {
> if (value.precision() > constraintValue)
> throw new ValidationException(buildMessage(formatter, field, 
> constraintValue));
> }
> private String buildMessage(MessageFormatter formatter, Field field, 
> Integer constraintValue) {
> return formatter.format(constraintValue, field.getLabel());
> }
>
> @Override
> public void render(Field field, Integer constraintValue, MessageFormatter 
> formatter, MarkupWriter writer,
> FormSupport formSupport) {
> formSupport.addValidation(field, "maxprecision", 
> buildMessage(formatter, field, constraintValue), constraintValue);
> }
> }
> //AppModule
> @SuppressWarnings("rawtypes")
> public static void 
> contributeFieldValidatorSource(MappedConfiguration 
> configuration) {
> configuration.add("maxScale", new MaxScale());
> configuration.add("maxPrecision", new MaxPrecision());
> } 



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-1947) BigDecimal Validator

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1947?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-1947:
---

Priority: Minor  (was: Major)

> BigDecimal Validator
> 
>
> Key: TAP5-1947
> URL: https://issues.apache.org/jira/browse/TAP5-1947
> Project: Tapestry 5
>  Issue Type: Improvement
>  Components: tapestry-core
>Affects Versions: 5.3.3
>Reporter: George Christman
>Priority: Minor
>  Labels: features
>
> Tapestry should offer the ability to validate BigDecimal max length's for 
> currency/amounts. I'm donating the following code which validates maxScale 
> and maxPrecision. Unfortunately, I haven't written anything to handle the 
> clientside validation. 
> //app.properties
> maximum-precision=You may provide at most %d numbers for %s.
> maximum-scale=You may provide at most %d decimal digits for %s.
> //MaxScale
> public class MaxScale extends AbstractValidator {
> public MaxScale() {
> super(Integer.class, BigDecimal.class, "maximum-scale");
> }
> @Override
> public void validate(Field field, Integer constraintValue, 
> MessageFormatter formatter, BigDecimal value)
> throws ValidationException
> {
> if (value.scale() > constraintValue)
> throw new ValidationException(buildMessage(formatter, field, 
> constraintValue));
> }
> private String buildMessage(MessageFormatter formatter, Field field, 
> Integer constraintValue) {
> return formatter.format(constraintValue, field.getLabel());
> }
>
> @Override
> public void render(Field field, Integer constraintValue, MessageFormatter 
> formatter, MarkupWriter writer,
> FormSupport formSupport) {
> formSupport.addValidation(field, "maxscale", buildMessage(formatter, 
> field, constraintValue), constraintValue);
> }
> }
> //MaxPrecision
> public class MaxPrecision extends AbstractValidator {
> public MaxPrecision() {
> super(Integer.class, BigDecimal.class, "maximum-precision");
> }
> @Override
> public void validate(Field field, Integer constraintValue, 
> MessageFormatter formatter, BigDecimal value)
> throws ValidationException
> {
> if (value.precision() > constraintValue)
> throw new ValidationException(buildMessage(formatter, field, 
> constraintValue));
> }
> private String buildMessage(MessageFormatter formatter, Field field, 
> Integer constraintValue) {
> return formatter.format(constraintValue, field.getLabel());
> }
>
> @Override
> public void render(Field field, Integer constraintValue, MessageFormatter 
> formatter, MarkupWriter writer,
> FormSupport formSupport) {
> formSupport.addValidation(field, "maxprecision", 
> buildMessage(formatter, field, constraintValue), constraintValue);
> }
> }
> //AppModule
> @SuppressWarnings("rawtypes")
> public static void 
> contributeFieldValidatorSource(MappedConfiguration 
> configuration) {
> configuration.add("maxScale", new MaxScale());
> configuration.add("maxPrecision", new MaxPrecision());
> } 



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: TAP5-1941: Alerts component can fail with ComponentEventException is dismiss event triggered outside of XHR request (e.g., by web crawler)

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master d9b3813a0 -> 0d3c9bc95


TAP5-1941: Alerts component can fail with ComponentEventException is dismiss 
event triggered outside of XHR request (e.g., by web crawler)


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/0d3c9bc9
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/0d3c9bc9
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/0d3c9bc9

Branch: refs/heads/master
Commit: 0d3c9bc950adcf837ae4378e2efe490763cc10fa
Parents: d9b3813
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 10:22:26 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 10:22:26 2014 -0700

--
 .../apache/tapestry5/corelib/components/Alerts.java   | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0d3c9bc9/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java
index c8bc5bb..16408c2 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java
@@ -1,5 +1,3 @@
-// Copyright 2011-2013 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
@@ -23,6 +21,7 @@ import org.apache.tapestry5.annotations.*;
 import org.apache.tapestry5.corelib.base.BaseClientElement;
 import org.apache.tapestry5.ioc.annotations.Inject;
 import org.apache.tapestry5.json.JSONObject;
+import org.apache.tapestry5.services.Request;
 import org.apache.tapestry5.services.compatibility.DeprecationWarning;
 
 /**
@@ -44,7 +43,7 @@ public class Alerts extends BaseClientElement
  * Allows the button used to dismiss all alerts to be customized (and 
localized).
  *
  * @deprecated Deprecated in Tapestry 5.4; override the {@code 
core-dismiss-label} message key in
- * your application's message catalog. This parameter is now 
ignored.
+ * your application's message catalog. This parameter is now ignored.
  */
 @Parameter(value = "message:core-dismiss-label", defaultPrefix = 
BindingConstants.LITERAL)
 private String dismissText;
@@ -63,6 +62,9 @@ public class Alerts extends BaseClientElement
 @Inject
 private DeprecationWarning deprecationWarning;
 
+@Inject
+private Request request;
+
 void onPageLoaded()
 {
 deprecationWarning.ignoredComponentParameters(resources, 
"dismissText");
@@ -100,6 +102,12 @@ public class Alerts extends BaseClientElement
 }
 }
 
+// See TAP5-1941
+if (!request.isXHR())
+{
+return true;
+}
+
 return new JSONObject();
 }
 



[jira] [Closed] (TAP5-1941) Alerts component can fail with ComponentEventException is dismiss event triggered outside of XHR request (e.g., by web crawler)

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-1941.
--

   Resolution: Fixed
Fix Version/s: 5.4

> Alerts component can fail with ComponentEventException is dismiss event 
> triggered outside of XHR request (e.g., by web crawler)
> ---
>
> Key: TAP5-1941
> URL: https://issues.apache.org/jira/browse/TAP5-1941
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.3
>Reporter: Felix Gonschorek
>Assignee: Howard M. Lewis Ship
>Priority: Minor
> Fix For: 5.4
>
>
> The Alerts component does not check for request.isXHR() in the "onDismiss" 
> event handler. 
> Crawlers (Googlebot) send non-xhr requests to the "onDismiss" event-url and 
> generate errors on my server, because the returned JSONObject is not a valid 
> return value from an event handler.
> org.apache.tapestry5.runtime.ComponentEventException: A component event 
> handler method returned the value {}. Return type 
> org.apache.tapestry5.json.JSONObject can not be handled. 
> A check for request.isXHR() and a conditional return value (null for non-ajax 
> requests, the json object for ajax requests) should fix this.
> thanks!



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-2100) ZoneRefresh mixin triggers refresh event with wrong context

2014-08-01 Thread Jochen Kemnade (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jochen Kemnade updated TAP5-2100:
-

Affects Version/s: 5.4

> ZoneRefresh mixin triggers refresh event with wrong context
> ---
>
> Key: TAP5-2100
> URL: https://issues.apache.org/jira/browse/TAP5-2100
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6, 5.4
>Reporter: Ivan Khalopik
>  Labels: patch
> Attachments: 
> 0001-TAP5-2100-ZoneRefresh-mixin-triggers-refresh-event-w.patch
>
>
> ZoneRefresh mixin triggers refresh event with context populated from 
> parameter instead of context from event link. 
> Before render script it creates event link with context:
>private Object createEventLink()
>{
>   Link link = resources.createEventLink("zoneRefresh", context);
>   return link.toAbsoluteURI();
>}
>
> But then it uses context parameter instead of context from event link:
>Object onZoneRefresh()
>{
>   CaptureResultCallback callback = new 
> CaptureResultCallback();
>   resources.triggerEvent(EventConstants.REFRESH, context, callback);
>   
>   if(callback.getResult() != null){
>  return callback.getResult();
>   }
>   
>   return zone.getBody();
>}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-1941) Alerts component can fail with ComponentEventException is dismiss event triggered outside of XHR request (e.g., by web crawler)

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-1941:
---

Summary: Alerts component can fail with ComponentEventException is dismiss 
event triggered outside of XHR request (e.g., by web crawler)  (was: Alerts 
component can fail with )

> Alerts component can fail with ComponentEventException is dismiss event 
> triggered outside of XHR request (e.g., by web crawler)
> ---
>
> Key: TAP5-1941
> URL: https://issues.apache.org/jira/browse/TAP5-1941
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.3
>Reporter: Felix Gonschorek
>Assignee: Howard M. Lewis Ship
>Priority: Minor
> Fix For: 5.4
>
>
> The Alerts component does not check for request.isXHR() in the "onDismiss" 
> event handler. 
> Crawlers (Googlebot) send non-xhr requests to the "onDismiss" event-url and 
> generate errors on my server, because the returned JSONObject is not a valid 
> return value from an event handler.
> org.apache.tapestry5.runtime.ComponentEventException: A component event 
> handler method returned the value {}. Return type 
> org.apache.tapestry5.json.JSONObject can not be handled. 
> A check for request.isXHR() and a conditional return value (null for non-ajax 
> requests, the json object for ajax requests) should fix this.
> thanks!



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-1941) Alerts component can fail with

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-1941:
---

Summary: Alerts component can fail with   (was: Alerts component should 
check for XHR request in "dismiss" event handler)

> Alerts component can fail with 
> ---
>
> Key: TAP5-1941
> URL: https://issues.apache.org/jira/browse/TAP5-1941
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.3
>Reporter: Felix Gonschorek
>Assignee: Howard M. Lewis Ship
>Priority: Minor
> Fix For: 5.4
>
>
> The Alerts component does not check for request.isXHR() in the "onDismiss" 
> event handler. 
> Crawlers (Googlebot) send non-xhr requests to the "onDismiss" event-url and 
> generate errors on my server, because the returned JSONObject is not a valid 
> return value from an event handler.
> org.apache.tapestry5.runtime.ComponentEventException: A component event 
> handler method returned the value {}. Return type 
> org.apache.tapestry5.json.JSONObject can not be handled. 
> A check for request.isXHR() and a conditional return value (null for non-ajax 
> requests, the json object for ajax requests) should fix this.
> thanks!



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-1941) Alerts component can fail with ComponentEventException is dismiss event triggered outside of XHR request (e.g., by web crawler)

2014-08-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-1941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082555#comment-14082555
 ] 

ASF subversion and git services commented on TAP5-1941:
---

Commit 0d3c9bc950adcf837ae4378e2efe490763cc10fa in tapestry-5's branch 
refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=0d3c9bc ]

TAP5-1941: Alerts component can fail with ComponentEventException is dismiss 
event triggered outside of XHR request (e.g., by web crawler)


> Alerts component can fail with ComponentEventException is dismiss event 
> triggered outside of XHR request (e.g., by web crawler)
> ---
>
> Key: TAP5-1941
> URL: https://issues.apache.org/jira/browse/TAP5-1941
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.3
>Reporter: Felix Gonschorek
>Assignee: Howard M. Lewis Ship
>Priority: Minor
> Fix For: 5.4
>
>
> The Alerts component does not check for request.isXHR() in the "onDismiss" 
> event handler. 
> Crawlers (Googlebot) send non-xhr requests to the "onDismiss" event-url and 
> generate errors on my server, because the returned JSONObject is not a valid 
> return value from an event handler.
> org.apache.tapestry5.runtime.ComponentEventException: A component event 
> handler method returned the value {}. Return type 
> org.apache.tapestry5.json.JSONObject can not be handled. 
> A check for request.isXHR() and a conditional return value (null for non-ajax 
> requests, the json object for ajax requests) should fix this.
> thanks!



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-2360) Floating console appears in production mode

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2360.
--

Resolution: Invalid

Don't have JavaScript errors in production.

> Floating console appears in production mode
> ---
>
> Key: TAP5-2360
> URL: https://issues.apache.org/jira/browse/TAP5-2360
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: yiannis pericleous
>
> The floating javascript console appears in IE if there are javascript errors 
> for requirejs in the page and tapestry.production-mode=true in web.xml. It 
> should only appear in dev mode.
> To reproduce (I tried this in IE 8 and 9):
> web.xml:
> tapestry.production-mode = true
> In a page.java:
> javascriptSupport_.require("test");
> test.js:
> (function() {  define([], function() {
> aaa;
> })}).call(this);
> using 5.4-beta-6



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Assigned] (TAP5-2278) ModuleDispatcher returns start page for requests to nonexistent modules

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship reassigned TAP5-2278:
--

Assignee: Howard M. Lewis Ship

> ModuleDispatcher returns start page for requests to nonexistent modules
> ---
>
> Key: TAP5-2278
> URL: https://issues.apache.org/jira/browse/TAP5-2278
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Jochen Kemnade
>Assignee: Howard M. Lewis Ship
>
> A request to {code}${BASE_URL}/modules.gz/t5/core/xyz.js{code} returns the 
> index page, it should return a HTTP 404 instead.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: TAP5-2278: ModuleDispatcher should send 404 response when the request includes the prefix, but not a valid module path

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master 0d3c9bc95 -> 37c2f877b


TAP5-2278: ModuleDispatcher should send 404 response when the request includes 
the prefix, but not a valid module path


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/37c2f877
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/37c2f877
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/37c2f877

Branch: refs/heads/master
Commit: 37c2f877be6fc7181c37bcfc8493f396409f90e8
Parents: 0d3c9bc
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 10:38:27 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 10:38:27 2014 -0700

--
 .../services/javascript/ModuleDispatcher.java | 18 ++
 .../javascript/ModuleDispatcherTests.groovy   | 14 --
 2 files changed, 26 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/37c2f877/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleDispatcher.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleDispatcher.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleDispatcher.java
index a841578..372fabd 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleDispatcher.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleDispatcher.java
@@ -1,5 +1,3 @@
-// Copyright 2012, 2013 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
@@ -25,6 +23,7 @@ import org.apache.tapestry5.services.Request;
 import org.apache.tapestry5.services.Response;
 import org.apache.tapestry5.services.javascript.ModuleManager;
 
+import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.util.EnumSet;
 import java.util.Set;
@@ -69,8 +68,19 @@ public class ModuleDispatcher implements Dispatcher
 {
 String path = request.getPath();
 
-return path.startsWith(requestPrefix) &&
-handleModuleRequest(path.substring(requestPrefix.length()));
+if (path.startsWith(requestPrefix))
+{
+String extraPath = path.substring(requestPrefix.length());
+
+if (! handleModuleRequest(extraPath))
+{
+response.sendError(HttpServletResponse.SC_NOT_FOUND, 
String.format("No module for path '%s'.", extraPath));
+}
+
+return true;
+}
+
+return false;
 
 }
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/37c2f877/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleDispatcherTests.groovy
--
diff --git 
a/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleDispatcherTests.groovy
 
b/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleDispatcherTests.groovy
index c239026..30d0066 100644
--- 
a/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleDispatcherTests.groovy
+++ 
b/tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleDispatcherTests.groovy
@@ -5,25 +5,32 @@ import org.apache.tapestry5.ioc.internal.QuietOperationTracker
 import org.apache.tapestry5.ioc.test.TestBase
 import org.apache.tapestry5.services.PathConstructor
 import org.apache.tapestry5.services.Request
+import org.apache.tapestry5.services.Response
+import org.easymock.EasyMock
 import org.testng.annotations.DataProvider
 import org.testng.annotations.Test
 
+import javax.servlet.http.HttpServletResponse
+
 class ModuleDispatcherTests extends TestBase {
 
 @Test(dataProvider = "unknownPaths")
 void "invalid extension is ignored"(path) {
 def request = newMock Request
+def response = newMock Response
 def pc = newMock PathConstructor
 
 expect(pc.constructDispatchPath("modules")).andReturn("/modules")
 
 expect(request.path).andReturn(path)
 
+
expect(response.sendError(EasyMock.eq(HttpServletResponse.SC_NOT_FOUND), 
EasyMock.notNull()))
+
 replay()
 
 def handler = new ModuleDispatcher(null, null, new 
QuietOperationTracker(), pc, "modules", false)
 
-assert handler.dispatch(request, null) == false
+assert handler.dispatch(request, response) == true
 
 verify()
 }
@@ -43,6 +50,7 @@ class ModuleDispatcherTests extends TestBase {
 
 def manager = newMock ModuleMana

[jira] [Commented] (TAP5-2278) ModuleDispatcher should send 404 response when the request includes the prefix, but not a valid module path

2014-08-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082587#comment-14082587
 ] 

ASF subversion and git services commented on TAP5-2278:
---

Commit 37c2f877be6fc7181c37bcfc8493f396409f90e8 in tapestry-5's branch 
refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=37c2f87 ]

TAP5-2278: ModuleDispatcher should send 404 response when the request includes 
the prefix, but not a valid module path


> ModuleDispatcher should send 404 response when the request includes the 
> prefix, but not a valid module path
> ---
>
> Key: TAP5-2278
> URL: https://issues.apache.org/jira/browse/TAP5-2278
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Jochen Kemnade
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
>
> A request to {code}${BASE_URL}/modules.gz/t5/core/xyz.js{code} returns the 
> index page, it should return a HTTP 404 instead.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-2278) ModuleDispatcher should send 404 response when the request includes the prefix, but not a valid module path

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-2278:
---

Summary: ModuleDispatcher should send 404 response when the request 
includes the prefix, but not a valid module path  (was: ModuleDispatcher 
returns start page for requests to nonexistent modules)

> ModuleDispatcher should send 404 response when the request includes the 
> prefix, but not a valid module path
> ---
>
> Key: TAP5-2278
> URL: https://issues.apache.org/jira/browse/TAP5-2278
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Jochen Kemnade
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
>
> A request to {code}${BASE_URL}/modules.gz/t5/core/xyz.js{code} returns the 
> index page, it should return a HTTP 404 instead.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-2278) ModuleDispatcher should send 404 response when the request includes the prefix, but not a valid module path

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2278.
--

   Resolution: Fixed
Fix Version/s: 5.4

> ModuleDispatcher should send 404 response when the request includes the 
> prefix, but not a valid module path
> ---
>
> Key: TAP5-2278
> URL: https://issues.apache.org/jira/browse/TAP5-2278
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Jochen Kemnade
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
>
> A request to {code}${BASE_URL}/modules.gz/t5/core/xyz.js{code} returns the 
> index page, it should return a HTTP 404 instead.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-2042) Favico url malformed when the page has a context in the request

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2042?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-2042:
---

Priority: Minor  (was: Major)

> Favico url malformed when the page has a context in the request
> ---
>
> Key: TAP5-2042
> URL: https://issues.apache.org/jira/browse/TAP5-2042
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6
>Reporter: Matías Blasi
>Priority: Minor
>  Labels: activate, context, favicon
>
> When trying to acces to a page of my application "ticket/list" with a 
> context, like:
> http://localhost/ticket/list/1/8
> The page request is correctly processed, I get the page as expected, but, 
> there is a next request for the favico, with an incorrect url:
> Caused by: java.lang.NumberFormatException: For input string: "ico"
> at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> at java.lang.Long.parseLong(Long.java:438)
> at java.lang.Long.(Long.java:690)
> at 
> org.apache.tapestry5.ioc.services.TapestryIOCModule$9.coerce(TapestryIOCModule.java:241)
> at 
> org.apache.tapestry5.ioc.services.TapestryIOCModule$9.coerce(TapestryIOCModule.java:238)
> at 
> org.apache.tapestry5.ioc.services.CoercionTuple$CoercionWrapper.coerce(CoercionTuple.java:54)
> at 
> org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.coerce(TypeCoercerImpl.java:71)
> ... 87 more
> [INFO] ComexwebModule.TimingFilter Request time: 327 ms
> 0:0:0:0:0:0:0:1 -  -  [04/ene/2013:11:16:14 +] "GET 
> /ticket/list/1/ico/favicon.png HTTP/1.1" 500 4323 "-" "Mozilla/5.0 (X11; 
> Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.35 
> Safari/537.17"
> If I get the page with no activation context, everithing works fine.
> Regards,
> Matías.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-2118) Certain package naming patterns result in incorrect logical names for pages

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-2118:
---

Summary: Certain package naming patterns result in incorrect logical names 
for pages  (was: Bug in ComponentClassResolverImpl)

> Certain package naming patterns result in incorrect logical names for pages
> ---
>
> Key: TAP5-2118
> URL: https://issues.apache.org/jira/browse/TAP5-2118
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6
>Reporter: Thilo Tanner
>
> There is a small bug in ComponentClassResolverImpl in the method 
> toLogicalName.
> Consider the following page: pages.export.exports.ExportsIndex
> This page will be mapped to:
> export/exports/sIndex instead of export/exports
> It seems that stripTerm is invoked with export instead of exports.
> I can contribute a patch if you like. Please let me know.
> Thanks and kind regards,
> Thilo



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-2276) Error loading asset from inherited component from different library

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2276.
--

Resolution: Duplicate

I'm pretty sure this has already been fixed.

> Error loading asset from inherited component from different library
> ---
>
> Key: TAP5-2276
> URL: https://issues.apache.org/jira/browse/TAP5-2276
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Vladimir Velikiy
>  Labels: assets, component, inheritance
>
> I use component inheritance in my project. Parent component 'Dialog' is 
> located in library 'common'. It uses asset 'common.js' located in 
> META-INF/assets/common/common.js. When I use it in page it works fine, but if 
> I use inherited component FormDialog located in my application components 
> folder,  I get error: 'Unable to locate asset 'common.js' for component 
> request/Create:contractorcreatedialog. It should be located at 
> META-INF/assets/common.js'. Inherited component doesn't contain any @Import 
> annotations.
> This error occurs because method getComponentAsset(...) in AssetSourceImpl 
> uses ComponentResources of inherited component when calculates asset path and 
> gets incorrect (empty in my case) library path prefix instead of super 
> component library name.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-773) Select component should have parameter to allow option labels to be rendered w/o HTML entity escaping

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-773:
--

Summary: Select component should have parameter to allow option labels to 
be rendered w/o HTML entity escaping  (was: Select component renderer does not 
allow HTML entities)

> Select component should have parameter to allow option labels to be rendered 
> w/o HTML entity escaping
> -
>
> Key: TAP5-773
> URL: https://issues.apache.org/jira/browse/TAP5-773
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6, 5.2.5, 5.1.0.5
>Reporter: Andy Blower
>
> All ampersands that are returned from getLabel() in an OptionModel get 
> encoded to &.  This makes it impossible to use any html entities (— 
>   etc) within option labels in selects. This is not that uncommon and 
> should definitely be supported by Tapestry out of the box.
> It can be fixed by changing line 60 of 
> org.apache.tapestry5.internal.util.SelectModelRender from 
> writer.write(optionModel.getLabel());
> to
> writer.writeRaw(optionModel.getLabel());
> This would mean that ampersands will need to be encoded for option labels, 
> but this is at least possible for a developer to do. Currently it's not 
> possible to use entities without using a custom select component, you can't 
> even extend the T5 Select class and override the Render nested class.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: TAP5-773: Select component should have parameter to allow option labels to be rendered w/o HTML entity escaping

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master 37c2f877b -> 28b4dc805


TAP5-773: Select component should have parameter to allow option labels to be 
rendered w/o HTML entity escaping


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/28b4dc80
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/28b4dc80
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/28b4dc80

Branch: refs/heads/master
Commit: 28b4dc805dfc64891b89f8e5d83d6c5d42ff6b42
Parents: 37c2f87
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 11:26:02 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 11:26:02 2014 -0700

--
 .../tapestry5/corelib/components/Palette.java   |  4 +--
 .../tapestry5/corelib/components/Select.java| 35 ++--
 .../internal/util/SelectModelRenderer.java  | 16 ++---
 .../corelib/components/SelectTest.java  | 35 ++--
 .../components/output_with_raw_enabled.txt  |  2 ++
 5 files changed, 72 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/28b4dc80/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Palette.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Palette.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Palette.java
index 78339e1..764aa6d 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Palette.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Palette.java
@@ -1,5 +1,3 @@
-// Copyright 2007-2013 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
@@ -181,7 +179,7 @@ public class Palette extends AbstractField
 {
 public void render(MarkupWriter writer)
 {
-SelectModelRenderer visitor = new SelectModelRenderer(writer, 
encoder);
+SelectModelRenderer visitor = new SelectModelRenderer(writer, 
encoder, false);
 
 model.visit(visitor);
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/28b4dc80/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Select.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Select.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Select.java
index 7c13a46..44f4e79 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Select.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Select.java
@@ -1,5 +1,3 @@
-// Copyright 2007-2013 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
@@ -56,7 +54,7 @@ public class Select extends AbstractField
 
 public Renderer(MarkupWriter writer)
 {
-super(writer, encoder);
+super(writer, encoder, raw);
 }
 
 @Override
@@ -94,6 +92,15 @@ public class Select extends AbstractField
 private SecureOption secure;
 
 /**
+ * If true, then the provided {@link org.apache.tapestry5.SelectModel} 
labels will be written raw (no escaping of
+ * embedded HTML entities); it becomes the callers responsibility to 
escape any such entities.
+ *
+ * @since 5.4
+ */
+@Parameter(value = "false")
+private boolean raw;
+
+/**
  * The model used to identify the option groups and options to be 
presented to the user. This can be generated
  * automatically for Enum types.
  */
@@ -143,15 +150,15 @@ public class Select extends AbstractField
  */
 @Parameter(defaultPrefix = BindingConstants.LITERAL)
 private String zone;
-
+
 /**
- * The context for the "valueChanged" event triggered by this component 
(optional parameter). 
+ * The context for the "valueChanged" event triggered by this component 
(optional parameter).
  * This list of values will be converted into strings and included in
  * the URI. The strings will be coerced back to whatever their values are 
and made available to event handler
  * methods. The first parameter of the context passed to "valueChanged" 
event handlers will
  * still be the selected value chosen by the user, so the context passed 
through this parameter
  * will be added from the second position on.
- * 
+ *
  * @since 5.4
  */

[jira] [Closed] (TAP5-773) Select component should have parameter to allow option labels to be rendered w/o HTML entity escaping

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-773.
-

   Resolution: Fixed
Fix Version/s: 5.4
 Assignee: Howard M. Lewis Ship

> Select component should have parameter to allow option labels to be rendered 
> w/o HTML entity escaping
> -
>
> Key: TAP5-773
> URL: https://issues.apache.org/jira/browse/TAP5-773
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6, 5.2.5, 5.1.0.5
>Reporter: Andy Blower
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
>
> All ampersands that are returned from getLabel() in an OptionModel get 
> encoded to &.  This makes it impossible to use any html entities (— 
>   etc) within option labels in selects. This is not that uncommon and 
> should definitely be supported by Tapestry out of the box.
> It can be fixed by changing line 60 of 
> org.apache.tapestry5.internal.util.SelectModelRender from 
> writer.write(optionModel.getLabel());
> to
> writer.writeRaw(optionModel.getLabel());
> This would mean that ampersands will need to be encoded for option labels, 
> but this is at least possible for a developer to do. Currently it's not 
> possible to use entities without using a custom select component, you can't 
> even extend the T5 Select class and override the Render nested class.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-773) Select component should have parameter to allow option labels to be rendered w/o HTML entity escaping

2014-08-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082682#comment-14082682
 ] 

ASF subversion and git services commented on TAP5-773:
--

Commit 28b4dc805dfc64891b89f8e5d83d6c5d42ff6b42 in tapestry-5's branch 
refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=28b4dc8 ]

TAP5-773: Select component should have parameter to allow option labels to be 
rendered w/o HTML entity escaping


> Select component should have parameter to allow option labels to be rendered 
> w/o HTML entity escaping
> -
>
> Key: TAP5-773
> URL: https://issues.apache.org/jira/browse/TAP5-773
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6, 5.2.5, 5.1.0.5
>Reporter: Andy Blower
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
>
> All ampersands that are returned from getLabel() in an OptionModel get 
> encoded to &.  This makes it impossible to use any html entities (— 
>   etc) within option labels in selects. This is not that uncommon and 
> should definitely be supported by Tapestry out of the box.
> It can be fixed by changing line 60 of 
> org.apache.tapestry5.internal.util.SelectModelRender from 
> writer.write(optionModel.getLabel());
> to
> writer.writeRaw(optionModel.getLabel());
> This would mean that ampersands will need to be encoded for option labels, 
> but this is at least possible for a developer to do. Currently it's not 
> possible to use entities without using a custom select component, you can't 
> even extend the T5 Select class and override the Render nested class.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-2328) configuration.add(SymbolConstants.COMPONENT_RENDER_TRACING_ENABLED, "true") can break javascript by including HTML within Javascript

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2328.
--

Resolution: Won't Fix
  Assignee: Howard M. Lewis Ship

Inline JavaScript is problematic in Tapestry in a number of ways, and this 
option is one that is very rarely used (certainly not in production, rarely in 
development).

> configuration.add(SymbolConstants.COMPONENT_RENDER_TRACING_ENABLED, "true") 
> can break javascript by including HTML within Javascript
> 
>
> Key: TAP5-2328
> URL: https://issues.apache.org/jira/browse/TAP5-2328
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-ioc
>Affects Versions: 5.4
>Reporter: Basile Chandesris
>Assignee: Howard M. Lewis Ship
>Priority: Minor
>  Labels: developing_environment, javascript, tml
>
> When COMPONENT_RENDER_TRACING_ENABLED is active, html comments can be 
> included with Javascript code.
> Context: 5.4-beta-5
> Test done with uklance/tapestry-graphael/Pie Chart: 
>   Non /META-INF/assets compliant
>   and the javascript part impacted was included in the .tml file.
> Example: 
> https://github.com/uklance/tapestry-graphael/blob/master/tapestry-graphael-demo/src/main/resources/org/lazan/t5/graphael/demo/pages/PieChartDemo.tml
> error: 
>  ...
> \"font-weight\": 400 });\n}\n 
>});\n   }\n)(chart, r);})()"
> ...



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-2170) constructAssetPath() requires use of internal service

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2170.
--

Resolution: Invalid

The correct approach is to use Asset.toClientURL(), which does all the work of 
obtaining and using the StreamableResource based on the Asset (and it's 
underlying Resource).

> constructAssetPath() requires use of internal service
> -
>
> Key: TAP5-2170
> URL: https://issues.apache.org/jira/browse/TAP5-2170
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Lenny Primak
>Priority: Minor
>
> Since 5.4, constructAssetPath requires an argument that not easily obtained,
> and requires a use of internal API.
> Thread:
> http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/T5-4-Alpha-15-constructAssetPath-changes-td5723188.html



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-1766) New Message Catalogs are not Loaded "Live"

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-1766.
--

Resolution: Won't Fix

Under 5.4, the the T5Dashboard page (and related DevTools component) make it 
easy to flush out caches and force such things to be reloaded.

> New Message Catalogs are not Loaded "Live"
> --
>
> Key: TAP5-1766
> URL: https://issues.apache.org/jira/browse/TAP5-1766
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3
>Reporter: David Peterson
>Priority: Minor
>
> In development mode, if you add a brand new message catalog for a page, the 
> catalog does not appear to be loaded "live" but requires the server to be 
> restarted in order for the catalog to be picked up. After a restart, changes 
> to the messages in the catalog are updated live, however. 
> I've marked this "minor" rather than "trivial" because it's easy to work 
> around, but is confusing for someone trying to use Tapestry's message 
> catalogs for the first time. It makes it seem like the feature doesn't work 
> or the user has done something wrong.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-1754) BeanModelSource cannot introspect CGLIB proxies and anonymous classes

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-1754.
--

Resolution: Won't Fix

> BeanModelSource cannot introspect CGLIB proxies and anonymous classes
> -
>
> Key: TAP5-1754
> URL: https://issues.apache.org/jira/browse/TAP5-1754
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.2.6
>Reporter: Julian Vassev
>Priority: Minor
>  Labels: bulk-close-candidate
>
> When T5 is trying to create a BeanModel for displaying a row in a  it 
> examines the class of (maybe) the first element of the source list.
> Sometimes I put CGLIB proxies or Anonymous classes in the source list.
> When the class is anonymous, T5 complains about not being able to access  the 
> generated class
> java.lang.IllegalAccessError: tried to access class 
> pkg.impl.FileSystemArchiveRepository$3$1 from class 
> $PropertyConduit_133bd7cf475
> When accessing a CGLIB proxy:
> Render queue error in SetupRender[AddDomain:grid.columns]: Failure reading 
> parameter 'model' of component AddDomain:grid: Exception generating conduit 
> for expression 'exposeProxy': Class pkg.impl.DomainImpl does not contain a 
> property (or public field) named 'exposeProxy'
> I solved the problem by using T5 AOP (really great feature) but think it 
> should be handled by Tapestry:
> @Match("BeanModelSource")
> public static void adviseAll(MethodAdviceReceiver receiver) {
> MethodAdvice advice = new MethodAdvice() {
> @Override
> public void advise(Invocation invocation) {
> if (invocation.getMethodName().startsWith("create")) {
> Class clazz = (Class) invocation.getParameter(0);
> if (clazz.isAnonymousClass()) {
> invocation.override(0, 
> findFirstNonAnonymousParent(clazz));
> }
> //spring aop
> if (AopUtils.isCglibProxyClass(clazz)) {
> invocation.override(0, (clazz.getSuperclass()));
> }
> invocation.proceed();
> }
> }
> };
> receiver.adviseAllMethods(advice);
> }
> public static Class findFirstNonAnonymousParent(Class clazz) {
> while (clazz.isAnonymousClass()) {
> clazz = clazz.getSuperclass();
> }
> return clazz;
> }



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-1452) messages property lookup for enum values is inconsistent, and incorrect

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-1452.
--

Resolution: Won't Fix

Given that you have control over the names of these classes, and other options 
beyond relying on the message catalog to generate names, this bug is not 
prioritized to be fixed.

I would consider applying an up-to date patch, with tests.

> messages property lookup for enum values is inconsistent, and incorrect
> ---
>
> Key: TAP5-1452
> URL: https://issues.apache.org/jira/browse/TAP5-1452
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.2
>Reporter: Paul Stanton
>Priority: Minor
>  Labels: bulk-close-candidate
>
> I work on a project which has a few different entities each with their own 
> specific ranges of potential values for 'Category'. The way this project has 
> achieved this is to inline Enums within the entity class. Unfortunately, the 
> classes all define an enum named "Category", ie:
> public class EntityOne
> {
> enum Category {...};
> private Category category;
> 
> }
> public class EntityTwo
> {
> enum Category {...};
> private Category category;
> 
> }
> The EnumSelectModel uses TapestryInternalUtils.getLabelForEnum(Messages 
> messages, String prefix, Enum value) where prefix is enumClass.getSimpleName()
> This makes it impossible to differentiate inline enums in different classes 
> with the same name since EntityOne.Category and EntityTwo.Category would both 
> have the prefix "Category".
> After doing some further digging I also found that there was another way to 
> resolve a message for an enum value: 
> TapestryInternalUtils.getLabelForEnum(Messages messages, Enum value) which is 
> used by PropertyDisplayBlocks. This method is slightly better since it would 
> look for EntityOne$Category instead of just Category, however I think it 
> would be better still to use the fully qualified name.
> I think it is important to
> a) be consistent 
> b) allow for all cases
> Here is my solution:
> 1. scrap TapestryInternalUtils.getLabelForEnum(Messages messages, String 
> prefix, Enum value) and move the cascading logic into 
> TapestryInternalUtils.getLabelForEnum(Messages messages, Enum value), update 
> EnumSelectModel to use TapestryInternalUtils.getLabelForEnum(Messages 
> messages, Enum value).
> 2. change the cascading lookup logic to
>a) test for [value.getClass().getName() + "." + value.name()]
>b) test for [lastTerm(value.getClass().getName()) + "." + value.name()]
>c) test for [value.getClass().getSimpleName() + "." + value.name()]
>d) test for [value.name()]
> The code:
> public static String getLabelForEnum(Messages messages, Enum value)
> {
> String key1 = value.getClass().getName() + "." + value.name();
> if (messages.contains(key1))
> return messages.get(key1);
> String key2 = lastTerm(value.getClass().getName()) + "." + 
> value.name();
> if (messages.contains(key2))
> return messages.get(key2);
> String key3 = value.getClass().getSimpleName() + "." + value.name();
> if (messages.contains(key3))
> return messages.get(key3);
> String key4 = value.name();
> if (messages.contains(key4))
> return messages.get(key4);
> return toUserPresentable(value.name().toLowerCase());
> }
> EnumSelectModel and PropertyDisplayBlocks could use this without issue and be 
> fully backwards compatible with previously defined message properties.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-2170) constructAssetPath() requires use of internal service

2014-08-01 Thread Lenny Primak (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082716#comment-14082716
 ] 

Lenny Primak commented on TAP5-2170:


Agreed.  The above method works

> constructAssetPath() requires use of internal service
> -
>
> Key: TAP5-2170
> URL: https://issues.apache.org/jira/browse/TAP5-2170
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Lenny Primak
>Priority: Minor
>
> Since 5.4, constructAssetPath requires an argument that not easily obtained,
> and requires a use of internal API.
> Thread:
> http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/T5-4-Alpha-15-constructAssetPath-changes-td5723188.html



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-1430) Tapestry should detect when a parameter is bound to itself (as a property, as the default for the parameter) as this will cause an endless loop when the property is read or

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1430?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-1430.
--

Resolution: Won't Fix

Given that this is a bit of an edge case, I don't think we have the resources 
to fix this.  I would consider apply a valid patch that includes tests.

> Tapestry should detect when a parameter is bound to itself (as a property, as 
> the default for the parameter) as this will cause an endless loop when the 
> property is read or updated
> 
>
> Key: TAP5-1430
> URL: https://issues.apache.org/jira/browse/TAP5-1430
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3, 5.2
>Reporter: Joost Schouten
>Priority: Minor
>
> It is currently possible to bind a property to itself like so:
> @Property
> @Parameter(value="actionZone")
> private String actionZone;
> This causes a StackOverflowError where it should just assign the default 
> literal value "actionZone" to the property actionZone. Or it should complain 
> and throw an Exception informing the developer that you cannot bind in this 
> way without specifying the prefix literal:



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-2170) constructAssetPath() requires use of internal service

2014-08-01 Thread Lenny Primak (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082718#comment-14082718
 ] 

Lenny Primak commented on TAP5-2170:


Perhaps there should be some kind of migration document that includes this

> constructAssetPath() requires use of internal service
> -
>
> Key: TAP5-2170
> URL: https://issues.apache.org/jira/browse/TAP5-2170
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Lenny Primak
>Priority: Minor
>
> Since 5.4, constructAssetPath requires an argument that not easily obtained,
> and requires a use of internal API.
> Thread:
> http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/T5-4-Alpha-15-constructAssetPath-changes-td5723188.html



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-609) Upgrade to 5.1 broke a Loop that iterated over a two-dimensional double array

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-609?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-609.
-

Resolution: Won't Fix

Given that this is a bit of an edge case, I don't think we have the resources 
to fix this.  I would consider apply a valid patch that includes tests.

> Upgrade to 5.1 broke a Loop that iterated over a two-dimensional double array
> -
>
> Key: TAP5-609
> URL: https://issues.apache.org/jira/browse/TAP5-609
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.1.0.2
>Reporter: Shing Hing Man
>Priority: Minor
>  Labels: bulk-close-candidate
> Attachments: myapp.jar
>
>
> I have a component which uses two nested loop to input a two dimensional 
> array of Doubles. It works in Tapestry 5.0.18. In Tapestry 5.1.0.2 snapshot, 
> when I submit the form containing the above component, I get the following 
> error message.
> Could not find a coercion from type java.lang.String to type 
> [Ljava.lang.Double;. Available coercions: Double --> Float, Float --> Double, 
> Long --> Boolean, Long --> Byte, Long --> Double, Long --> Integer, Long --> 
> Short, Number --> Long, Object --> Object[], Object --> String, Object --> 
> java.util.List, Object[] --> java.util.List, String --> Boolean, String --> 
> Double, String --> Long, String --> java.io.File, String --> 
> java.math.BigDecimal, String --> java.math.BigInteger, String --> 
> java.text.DateFormat, String --> java.util.regex.Pattern, String --> 
> org.apache.tapestry5.Renderable, String --> org.apache.tapestry5.SelectModel, 
> String --> org.apache.tapestry5.corelib.data.BlankOption, String --> 
> org.apache.tapestry5.corelib.data.GridPagerPosition, String --> 
> org.apache.tapestry5.corelib.data.InsertPosition, String --> 
> org.apache.tapestry5.ioc.Resource, String --> 
> org.apache.tapestry5.ioc.util.TimeInterval, boolean[] --> java.util.List, 
> byte[] --> java.util.List, char[] --> java.util.List, double[] --> 
> java.util.List, float[] --> java.util.List, int[] --> java.util.List, 
> java.math.BigDecimal -
> # 
> org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.findOrCreateCoercion(TypeCoercerImpl.java:244)
> # 
> org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.access$000(TypeCoercerImpl.java:29)
> # 
> org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.getCoercion(TypeCoercerImpl.java:88)
> # 
> org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.coerce(TypeCoercerImpl.java:61)
> # 
> org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:133)
> # $TypeCoercer_1204ea4852e.coerce($TypeCoercer_1204ea4852e.java)
> # 
> org.apache.tapestry5.internal.services.TypeCoercedValueEncoderFactory$1.toValue(TypeCoercedValueEncoderFactory.java:45)
> # 
> org.apache.tapestry5.corelib.components.Loop.restoreStateFromStoredClientValue(Loop.java:423)
> # org.apache.tapestry5.corelib.components.Loop.access$500(Loop.java:41)
> # 
> org.apache.tapestry5.corelib.components.Loop$RestoreStateFromStoredClientValue.execute(Loop.java:162)
> # 
> org.apache.tapestry5.corelib.components.Loop$RestoreStateFromStoredClientValue.execute(Loop.java:151)
> # 
> org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:477)
> # 
> org.apache.tapestry5.corelib.components.Form._$advised$onAction(Form.java:375)
> # 
> org.apache.tapestry5.corelib.components.Form$onAction$invocation_1204ea4f004.invokeAdvisedMethod(Form$onAction$invocation_1204ea4f004.java)
> # 
> org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:71)
> # 
> org.apache.tapestry5.ioc.internal.services.LoggingAdvice.advise(LoggingAdvice.java:37)
> # 
> org.apache.tapestry5.internal.transform.LogWorker$1.advise(LogWorker.java:54)
> # 
> org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:80)
> # org.apache.tapestry5.corelib.components.Form.onAction(Form.java) 



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-2356) missing-key: a-string-is-a-string

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2356?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2356.
--

Resolution: Invalid

You can ignore your warning; the value is not used, since translation from 
string to string is trivial.

> missing-key: a-string-is-a-string
> -
>
> Key: TAP5-2356
> URL: https://issues.apache.org/jira/browse/TAP5-2356
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6, 5.4
>Reporter: Robert Hailey
>Priority: Trivial
>  Labels: easyfix, message, messages
>
> I'm not even sure if this ever makes it to the user, but it is flagged on my 
> custom "log missing keys" implementation.
> {noformat}
> tapestry-core/src/main/java/org/apache/tapestry5/internal/translator/StringTranslator.java:
> super("string", String.class, "a-string-is-a-string");
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-2348) Improve the JavaDoc for ComponentPageElement to explain what it is for

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-2348:
---

Summary: Improve the JavaDoc for ComponentPageElement to explain what it is 
for  (was: Unclear API doc description for ComponentPageElement)

> Improve the JavaDoc for ComponentPageElement to explain what it is for
> --
>
> Key: TAP5-2348
> URL: https://issues.apache.org/jira/browse/TAP5-2348
> Project: Tapestry 5
>  Issue Type: Documentation
>  Components: documentation
>Affects Versions: 5.3.7
>Reporter: Muhammad Gelbana
>Priority: Minor
>  Labels: documentation
>
> Could there be a better description than the current one which is: "Defines 
> an element of a page that is a component elements that are, in fact, 
> components (rather than just static markup)."
> The link for the API doc is: 
> http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/internal/structure/ComponentPageElement.html
> I couldn't understand it so I can't even suggest a better description.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: TAP5-2348: Improve the JavaDoc for ComponentPageElement to explain what it is for

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master 28b4dc805 -> 5abb9685d


TAP5-2348: Improve the JavaDoc for ComponentPageElement to explain what it is 
for


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/5abb9685
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/5abb9685
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/5abb9685

Branch: refs/heads/master
Commit: 5abb9685d466f92f42bf0235dfbe3585f2df1d22
Parents: 28b4dc8
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 11:50:39 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 11:50:39 2014 -0700

--
 .../structure/ComponentPageElement.java | 52 +---
 1 file changed, 33 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5abb9685/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElement.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElement.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElement.java
index 39d69ae..83a6d50 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElement.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElement.java
@@ -1,5 +1,3 @@
-// Copyright 2006, 2007, 2008, 2009, 2011 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
@@ -29,8 +27,9 @@ import org.apache.tapestry5.runtime.RenderQueue;
 import org.slf4j.Logger;
 
 /**
- * Defines an element of a page that is a component elements that are, in 
fact, components (rather than just static
- * markup).
+ * Defines an element of a {@link 
org.apache.tapestry5.internal.structure.Page} that is a full {@link 
org.apache.tapestry5.runtime.Component},
+ * including the possibility of its own template and mixins. This is distinct 
from other {@linkplain org.apache.tapestry5.runtime.RenderCommand renderable}
+ * elements of the page, which represent fixed or dynamic text, or markup 
element that may have dynamic attribute values.
  */
 public interface ComponentPageElement extends ComponentResourcesCommon, 
InternalComponentResourcesCommon, RenderCommand, BodyPageElement
 {
@@ -73,16 +72,22 @@ public interface ComponentPageElement extends 
ComponentResourcesCommon, Internal
 /**
  * Adds a mixin.
  *
- * @param mixinId  a unique id for the mixin, the last term of the 
mixin's class name
- * @param instantiator used to instantiate an instance of the mixin
- * @param orderOrdering strings used to determine the order of 
mixin execution.
+ * @param mixinId
+ * a unique id for the mixin, the last term of the mixin's class 
name
+ * @param instantiator
+ * used to instantiate an instance of the mixin
+ * @param order
+ * Ordering strings used to determine the order of mixin execution.
  */
 void addMixin(String mixinId, Instantiator instantiator, String... order);
 
 /**
- * @param mixinId   id of previously added mixin
- * @param parameterName simple (unqualified) name of parameter
- * @param binding   binding for parameter
+ * @param mixinId
+ * id of previously added mixin
+ * @param parameterName
+ * simple (unqualified) name of parameter
+ * @param binding
+ * binding for parameter
  * @since 5.1.0.0
  */
 void bindMixinParameter(String mixinId, String parameterName, Binding 
binding);
@@ -90,9 +95,11 @@ public interface ComponentPageElement extends 
ComponentResourcesCommon, Internal
 /**
  * Retrieves a component page element by its id. The search is caseless.
  *
- * @param id used to locate the element
+ * @param id
+ * used to locate the element
  * @return the page element
- * @throws IllegalArgumentException if no component exists with the given 
id
+ * @throws IllegalArgumentException
+ * if no component exists with the given id
  */
 ComponentPageElement getEmbeddedElement(String id);
 
@@ -100,9 +107,11 @@ public interface ComponentPageElement extends 
ComponentResourcesCommon, Internal
  * Returns the {@link org.apache.tapestry5.ComponentResources} for a mixin 
attached to this component element. Mixin
  * ids are the simple names of the mixin class.
  *
- * @param mixinId the mixin id (case insensitive)
+ * @param mixinId
+ * the mixin id (case 

[jira] [Commented] (TAP5-2348) Improve the JavaDoc for ComponentPageElement to explain what it is for

2014-08-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082739#comment-14082739
 ] 

ASF subversion and git services commented on TAP5-2348:
---

Commit 5abb9685d466f92f42bf0235dfbe3585f2df1d22 in tapestry-5's branch 
refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=5abb968 ]

TAP5-2348: Improve the JavaDoc for ComponentPageElement to explain what it is 
for


> Improve the JavaDoc for ComponentPageElement to explain what it is for
> --
>
> Key: TAP5-2348
> URL: https://issues.apache.org/jira/browse/TAP5-2348
> Project: Tapestry 5
>  Issue Type: Documentation
>  Components: documentation
>Affects Versions: 5.3.7
>Reporter: Muhammad Gelbana
>Assignee: Howard M. Lewis Ship
>Priority: Minor
>  Labels: documentation
> Fix For: 5.4
>
>
> Could there be a better description than the current one which is: "Defines 
> an element of a page that is a component elements that are, in fact, 
> components (rather than just static markup)."
> The link for the API doc is: 
> http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/internal/structure/ComponentPageElement.html
> I couldn't understand it so I can't even suggest a better description.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-2348) Improve the JavaDoc for ComponentPageElement to explain what it is for

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2348.
--

   Resolution: Fixed
Fix Version/s: 5.4
 Assignee: Howard M. Lewis Ship

> Improve the JavaDoc for ComponentPageElement to explain what it is for
> --
>
> Key: TAP5-2348
> URL: https://issues.apache.org/jira/browse/TAP5-2348
> Project: Tapestry 5
>  Issue Type: Documentation
>  Components: documentation
>Affects Versions: 5.3.7
>Reporter: Muhammad Gelbana
>Assignee: Howard M. Lewis Ship
>Priority: Minor
>  Labels: documentation
> Fix For: 5.4
>
>
> Could there be a better description than the current one which is: "Defines 
> an element of a page that is a component elements that are, in fact, 
> components (rather than just static markup)."
> The link for the API doc is: 
> http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/internal/structure/ComponentPageElement.html
> I couldn't understand it so I can't even suggest a better description.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-2210) Other ways of using tapestry (e.g. disable service reloading)

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2210?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2210.
--

Resolution: Won't Fix

If you wish to help with documentation, please file a CLA with Apache and get 
in contact with us to enable write access to the documentation wiki.

> Other ways of using tapestry (e.g. disable service reloading)
> -
>
> Key: TAP5-2210
> URL: https://issues.apache.org/jira/browse/TAP5-2210
> Project: Tapestry 5
>  Issue Type: Documentation
>  Components: documentation
>Affects Versions: 5.3.7
>Reporter: Chris Mylonas
>Priority: Minor
>
> Perhaps to save many people's time on the mailing list and dev - something 
> like an "alternatives" section in the docs for some of tapestry's features.
> Personally, I'm looking at tapestry for a 3rd time in the last few years for 
> a project and finally getting into the guts of it.
> e.g.
> Service Implementation Reloading
> There was this thread - 
> http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Switching-off-Reloading-of-Service-Implemenation-td5724115.html
>   which a simple "Alternative" section in the docs could have saved a few 
> man-hours.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: TAP5-2340: Make proxies honor Java 8 default methods

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master 5abb9685d -> 6a63c5166


TAP5-2340: Make proxies honor Java 8 default methods


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/6a63c516
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/6a63c516
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/6a63c516

Branch: refs/heads/master
Commit: 6a63c51669e950f40410cd44b45d0f0315c36659
Parents: 5abb968
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 11:57:48 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 11:57:48 2014 -0700

--
 .../tapestry5/internal/plastic/PlasticClassImpl.java | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6a63c516/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java
--
diff --git 
a/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java
 
b/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java
index 2b0fc15..328d2db 100644
--- 
a/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java
+++ 
b/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java
@@ -1,5 +1,3 @@
-// Copyright 2011, 2012 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
@@ -15,7 +13,6 @@
 package org.apache.tapestry5.internal.plastic;
 
 import org.apache.tapestry5.internal.plastic.asm.AnnotationVisitor;
-import org.apache.tapestry5.internal.plastic.asm.ClassReader;
 import org.apache.tapestry5.internal.plastic.asm.Opcodes;
 import org.apache.tapestry5.internal.plastic.asm.Type;
 import org.apache.tapestry5.internal.plastic.asm.tree.*;
@@ -811,6 +808,12 @@ public class PlasticClassImpl extends Lockable implements 
PlasticClass, Internal
 return new PlasticMethodImpl(this, methodNode);
 }
 
+private boolean isDefaultMethod(Method method)
+{
+return method.getDeclaringClass().isInterface() &&
+(method.getModifiers() & (Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC 
| Opcodes.ACC_ABSTRACT)) == Opcodes.ACC_PUBLIC;
+}
+
 private void createNewMethodImpl(MethodDescription methodDescription, 
MethodNode methodNode)
 {
 newBuilder(methodDescription, methodNode).returnDefaultValue();
@@ -1222,7 +1225,7 @@ public class PlasticClassImpl extends Lockable implements 
PlasticClass, Internal
 {
 MethodDescription description = new MethodDescription(m);
 
-if (!isMethodImplemented(description))
+if (!isMethodImplemented(description) && !isDefaultMethod(m))
 {
 introducedMethods.add(introduceMethod(m));
 }



[jira] [Closed] (TAP5-2340) Make proxies honor Java 8 default methods

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2340.
--

Resolution: Fixed
  Assignee: Howard M. Lewis Ship

Thanks for the patch!

> Make proxies honor Java 8 default methods
> -
>
> Key: TAP5-2340
> URL: https://issues.apache.org/jira/browse/TAP5-2340
> Project: Tapestry 5
>  Issue Type: Improvement
>  Components: plastic
>Affects Versions: 5.4
>Reporter: Peter Niederwieser
>Assignee: Howard M. Lewis Ship
> Attachments: plastic_default_methods.patch
>
>
> MyInterface.java:
> {code}
> public interface MyInterface {
>   default int compute() { return 42; }
> }
> {code}
> PlasticSpec.groovy:
> {code}
> class PlasticSpec extends Specification {
>   def "plastic proxy for interface with default method"() {
> def manager = 
> PlasticManager.withClassLoader(getClass().classLoader).create()
> def proxy = manager.createProxy(MyInterface, {})
> def impl = proxy.newInstance()
> expect:
> impl.compute() == 42 // fails; actual: 0
>   }
>   def "manual implementation of interface with default method"() {
> def impl = new MyInterface() {}
> expect:
> impl.compute() == 42 // passes
>   }
> }
> {code}
> Tested with 5.4-beta-6.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-2340) Make proxies honor Java 8 default methods

2014-08-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082756#comment-14082756
 ] 

ASF subversion and git services commented on TAP5-2340:
---

Commit 6a63c51669e950f40410cd44b45d0f0315c36659 in tapestry-5's branch 
refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=6a63c51 ]

TAP5-2340: Make proxies honor Java 8 default methods


> Make proxies honor Java 8 default methods
> -
>
> Key: TAP5-2340
> URL: https://issues.apache.org/jira/browse/TAP5-2340
> Project: Tapestry 5
>  Issue Type: Improvement
>  Components: plastic
>Affects Versions: 5.4
>Reporter: Peter Niederwieser
>Assignee: Howard M. Lewis Ship
> Attachments: plastic_default_methods.patch
>
>
> MyInterface.java:
> {code}
> public interface MyInterface {
>   default int compute() { return 42; }
> }
> {code}
> PlasticSpec.groovy:
> {code}
> class PlasticSpec extends Specification {
>   def "plastic proxy for interface with default method"() {
> def manager = 
> PlasticManager.withClassLoader(getClass().classLoader).create()
> def proxy = manager.createProxy(MyInterface, {})
> def impl = proxy.newInstance()
> expect:
> impl.compute() == 42 // fails; actual: 0
>   }
>   def "manual implementation of interface with default method"() {
> def impl = new MyInterface() {}
> expect:
> impl.compute() == 42 // passes
>   }
> }
> {code}
> Tested with 5.4-beta-6.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-1941) Alerts component can fail with ComponentEventException is dismiss event triggered outside of XHR request (e.g., by web crawler)

2014-08-01 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-1941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082774#comment-14082774
 ] 

Hudson commented on TAP5-1941:
--

ABORTED: Integrated in tapestry-trunk-freestyle #1292 (See 
[https://builds.apache.org/job/tapestry-trunk-freestyle/1292/])
TAP5-1941: Alerts component can fail with ComponentEventException is dismiss 
event triggered outside of XHR request (e.g., by web crawler) (hlship: rev 
0d3c9bc950adcf837ae4378e2efe490763cc10fa)
* 
tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java


> Alerts component can fail with ComponentEventException is dismiss event 
> triggered outside of XHR request (e.g., by web crawler)
> ---
>
> Key: TAP5-1941
> URL: https://issues.apache.org/jira/browse/TAP5-1941
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.3
>Reporter: Felix Gonschorek
>Assignee: Howard M. Lewis Ship
>Priority: Minor
> Fix For: 5.4
>
>
> The Alerts component does not check for request.isXHR() in the "onDismiss" 
> event handler. 
> Crawlers (Googlebot) send non-xhr requests to the "onDismiss" event-url and 
> generate errors on my server, because the returned JSONObject is not a valid 
> return value from an event handler.
> org.apache.tapestry5.runtime.ComponentEventException: A component event 
> handler method returned the value {}. Return type 
> org.apache.tapestry5.json.JSONObject can not be handled. 
> A check for request.isXHR() and a conditional return value (null for non-ajax 
> requests, the json object for ajax requests) should fix this.
> thanks!



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-1481) In production mode, component event requests that reference an unknown component should respond with a 404

2014-08-01 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-1481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082776#comment-14082776
 ] 

Hudson commented on TAP5-1481:
--

ABORTED: Integrated in tapestry-trunk-freestyle #1292 (See 
[https://builds.apache.org/job/tapestry-trunk-freestyle/1292/])
TAP5-1481: In production mode, component event requests that reference an 
unknown component should respond with a 404 (hlship: rev 
d9b3813a09c0d685b28b36192f578b01744af725)
* 
tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app5/services/AppModule.groovy
* 
tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app5/ProductionModeTests.groovy
* 
tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageRenderDispatcher.java
* 
tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ComponentEventDispatcherTest.java
* tapestry-core/src/test/conf/testng.xml
* tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java
* 
tapestry-core/src/main/java/org/apache/tapestry5/internal/InternalConstants.java
* 
tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentEventRequestHandlerImpl.java
* 
tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentEventDispatcher.java
* tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/Page.java
* 
tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ProductionModeUnknownComponentFilter.java


> In production mode, component event requests that reference an unknown 
> component should respond with a 404
> --
>
> Key: TAP5-1481
> URL: https://issues.apache.org/jira/browse/TAP5-1481
> Project: Tapestry 5
>  Issue Type: Improvement
>  Components: tapestry-core
>Affects Versions: 5.2
>Reporter: Anton Litvinenko
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
>
> when an embedded component cannot be found by id, then 
> ComponentPageElementImpl throws a TapestryException at line 841 for 5.1.0.5 
> (UnknownValueException for 5.2.4).
> I suggest throwing a special kind of exception in such case (e.g. 
> EmbeddedComponentNotFoundException or ComponentNotFoundException), so that 
> application would be able to handle such cases separately (e.g. by serving a 
> 404 error page).
> Particular use-case: google indexing bot cached a tapestry page and tries 
> indexing links that are included on this page. If links are actionlinks, then 
> they include id of the component. When one changes the id of the component 
> (or renames the component), then the "old" link doesn't work anymore as it 
> contains old id of the component -> google indexing bot is served with 
> Tapestry error page (which is a typical page). Instead, it makes sense to 
> send a 404 error as result and let google bot know that there is no such 
> resource anymore. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-2278) ModuleDispatcher should send 404 response when the request includes the prefix, but not a valid module path

2014-08-01 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082777#comment-14082777
 ] 

Hudson commented on TAP5-2278:
--

ABORTED: Integrated in tapestry-trunk-freestyle #1292 (See 
[https://builds.apache.org/job/tapestry-trunk-freestyle/1292/])
TAP5-2278: ModuleDispatcher should send 404 response when the request includes 
the prefix, but not a valid module path (hlship: rev 
37c2f877be6fc7181c37bcfc8493f396409f90e8)
* 
tapestry-core/src/test/groovy/org/apache/tapestry5/services/javascript/ModuleDispatcherTests.groovy
* 
tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/ModuleDispatcher.java


> ModuleDispatcher should send 404 response when the request includes the 
> prefix, but not a valid module path
> ---
>
> Key: TAP5-2278
> URL: https://issues.apache.org/jira/browse/TAP5-2278
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Jochen Kemnade
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
>
> A request to {code}${BASE_URL}/modules.gz/t5/core/xyz.js{code} returns the 
> index page, it should return a HTTP 404 instead.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-2364) Tapestry can use prohibited operations in some environments, such as Google App Engine

2014-08-01 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082775#comment-14082775
 ] 

Hudson commented on TAP5-2364:
--

ABORTED: Integrated in tapestry-trunk-freestyle #1292 (See 
[https://builds.apache.org/job/tapestry-trunk-freestyle/1292/])
TAP5-2364: Tapestry can use prohibited operations in some environments, such as 
Google App Engine (hlship: rev 7345bfb29bbb995209fcfb9f98f365b1cb643f68)
* 
tapestry-webresources/src/main/java/org/apache/tapestry5/internal/webresources/ResourceTransformerFactoryImpl.java
* tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java
* tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java
* 
tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java


> Tapestry can use prohibited operations in some environments, such as Google 
> App Engine
> --
>
> Key: TAP5-2364
> URL: https://issues.apache.org/jira/browse/TAP5-2364
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-webresources
>Affects Versions: 5.4
>Reporter: Jonathan Williams
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
>
> beta15 breaks GAE & some other prod environments
> I have a couple of app engine apps that are broken w/ beta15
> This is due to use of java.io.File to mkdir, which is prohibited on app 
> engine and is more generally considered a JEE no-no.
> ...
> ResourceTransformerFactoryImpl creates a File for the asset cache directory.
> This breaks my app in GAE, since creating a new File is prohibited.
> ...
> it looks like the cache is only used in development
> mode but still references File in production (thus breaking GAE). Perhaps a
> proper fix will involve a pluggable cache which does nothing in production
> mode.
> As a workaround you can override the ResourceTransformerFactory via ioc
> with an implementation that doesn't reference java.io.File. Most likely a
> copy/paste/tweak of the current version.
> ...
> Note, this could also break non GAE environments since it calls mkdirs() on
> @Symbol(WebResourcesSymbols.CACHE_DIR). For example a unix server without
> write permission.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: TAP5-2336: Trade some memory to remove lock contention resolving resources on the classpath

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master 6a63c5166 -> 7e710abee


TAP5-2336: Trade some memory to remove lock contention resolving resources on 
the classpath


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/7e710abe
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/7e710abe
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/7e710abe

Branch: refs/heads/master
Commit: 7e710abee2dc00d73149ba301c80af5f5df8269d
Parents: 6a63c51
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 12:47:35 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 12:47:35 2014 -0700

--
 .../org/apache/tapestry5/internal/services/AssetSourceImpl.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7e710abe/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetSourceImpl.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetSourceImpl.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetSourceImpl.java
index 42e339b..cfafcba 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetSourceImpl.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetSourceImpl.java
@@ -55,7 +55,7 @@ public class AssetSourceImpl extends LockSupport implements 
AssetSource
 
 private final Map prefixToRootResource = 
CollectionFactory.newMap();
 
-private final Map> cache = new 
WeakHashMap>();
+private final Map> cache = 
CollectionFactory.newConcurrentMap();
 
 private final SymbolSource symbolSource;
 



[jira] [Closed] (TAP5-2336) Lock contention in AssetSourceImp

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2336.
--

   Resolution: Fixed
Fix Version/s: 5.4
 Assignee: Howard M. Lewis Ship

> Lock contention in AssetSourceImp
> -
>
> Key: TAP5-2336
> URL: https://issues.apache.org/jira/browse/TAP5-2336
> Project: Tapestry 5
>  Issue Type: Improvement
>Reporter: Michael Mikhulya
>Assignee: Howard M. Lewis Ship
>  Labels: performance
> Fix For: 5.4
>
>
> While benchmarking tapestry framework with concurency level = 4 I found lock 
> contention in AssetSourceImpl.java.
> Lock looks as follows:
> {quote}
> java.lang.Thread.State: BLOCKED (on object monitor)
> at java.util.zip.ZipFile.getEntry(ZipFile.java:304)
> - locked <0x000711ee6800> (a java.util.jar.JarFile)
> at java.util.jar.JarFile.getEntry(JarFile.java:226)
> at java.util.jar.JarFile.getJarEntry(JarFile.java:209)
> at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:840)
> at sun.misc.URLClassPath$JarLoader.findResource(URLClassPath.java:818)
> at sun.misc.URLClassPath.findResource(URLClassPath.java:176)
> at java.net.URLClassLoader$2.run(URLClassLoader.java:551)
> at java.net.URLClassLoader$2.run(URLClassLoader.java:549)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findResource(URLClassLoader.java:548)
> at java.lang.ClassLoader.getResource(ClassLoader.java:1139)
> at java.lang.ClassLoader.getResource(ClassLoader.java:1134)
> at 
> org.apache.catalina.loader.WebappClassLoader.getResource(WebappClassLoader.java:1417)
> at 
> org.apache.tapestry5.ioc.internal.util.ClasspathResource.resolveURL(ClasspathResource.java:79)
> at 
> org.apache.tapestry5.ioc.internal.util.ClasspathResource.toURL(ClasspathResource.java:61)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.computeExists(AbstractResource.java:236)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.exists(AbstractResource.java:218)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.findLocalizedResource(AbstractResource.java:177)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.populateLocalizationCache(AbstractResource.java:159)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.forLocale(AbstractResource.java:136)
> at 
> org.apache.tapestry5.internal.services.AssetSourceImpl.getLocalizedAssetFromResource(AssetSourceImpl.java:134)
> at 
> org.apache.tapestry5.internal.services.AssetSourceImpl.getAssetInLocale(AssetSourceImpl.java:107)
> at 
> org.apache.tapestry5.internal.services.AssetSourceImpl.getAsset(AssetSourceImpl.java:87)
> at $AssetSource_369c373aab0b9a.getAsset(Unknown Source)
> at 
> org.apache.tapestry5.internal.services.javascript.CoreJavaScriptStack.getJavaScriptLibraries(CoreJavaScriptStack.java:154)
> {quote}
> Here is a cache to prevent lock contention, but I'm not sure whether it works 
> properly.
> {code:title=AssetSourceImpl.java}
> private final Map> cache = new 
> WeakHashMap>();
> {code}
> Here the problem is that Resource is used as a key.
> So the cache entry will be removed as soon as key is available for garbage 
> collection.
> Resources aren't always long-lived objects.
> For example resources produced by AssetSourceImpl.findResource(Resource 
> baseResource, String path) has a very short lifecycle.
> It would be good to use SoftHashMap instead of WeakHashMap here, but it is 
> not included in standard Java.
> To check my assumption I created cache based on ConcurrentHashMap instead of 
> WeakHashMap. As result of it lock contention disappeared and overall 
> performance increased.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-2336) Lock contention in AssetSourceImp

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082833#comment-14082833
 ] 

Howard M. Lewis Ship commented on TAP5-2336:


I committing this now, and hoping we don't have to back down later. I suspect 
this will use a bit more memory, and how much more (especially on very large 
deployments) makes me nervous.

> Lock contention in AssetSourceImp
> -
>
> Key: TAP5-2336
> URL: https://issues.apache.org/jira/browse/TAP5-2336
> Project: Tapestry 5
>  Issue Type: Improvement
>Reporter: Michael Mikhulya
>  Labels: performance
> Fix For: 5.4
>
>
> While benchmarking tapestry framework with concurency level = 4 I found lock 
> contention in AssetSourceImpl.java.
> Lock looks as follows:
> {quote}
> java.lang.Thread.State: BLOCKED (on object monitor)
> at java.util.zip.ZipFile.getEntry(ZipFile.java:304)
> - locked <0x000711ee6800> (a java.util.jar.JarFile)
> at java.util.jar.JarFile.getEntry(JarFile.java:226)
> at java.util.jar.JarFile.getJarEntry(JarFile.java:209)
> at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:840)
> at sun.misc.URLClassPath$JarLoader.findResource(URLClassPath.java:818)
> at sun.misc.URLClassPath.findResource(URLClassPath.java:176)
> at java.net.URLClassLoader$2.run(URLClassLoader.java:551)
> at java.net.URLClassLoader$2.run(URLClassLoader.java:549)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findResource(URLClassLoader.java:548)
> at java.lang.ClassLoader.getResource(ClassLoader.java:1139)
> at java.lang.ClassLoader.getResource(ClassLoader.java:1134)
> at 
> org.apache.catalina.loader.WebappClassLoader.getResource(WebappClassLoader.java:1417)
> at 
> org.apache.tapestry5.ioc.internal.util.ClasspathResource.resolveURL(ClasspathResource.java:79)
> at 
> org.apache.tapestry5.ioc.internal.util.ClasspathResource.toURL(ClasspathResource.java:61)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.computeExists(AbstractResource.java:236)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.exists(AbstractResource.java:218)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.findLocalizedResource(AbstractResource.java:177)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.populateLocalizationCache(AbstractResource.java:159)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.forLocale(AbstractResource.java:136)
> at 
> org.apache.tapestry5.internal.services.AssetSourceImpl.getLocalizedAssetFromResource(AssetSourceImpl.java:134)
> at 
> org.apache.tapestry5.internal.services.AssetSourceImpl.getAssetInLocale(AssetSourceImpl.java:107)
> at 
> org.apache.tapestry5.internal.services.AssetSourceImpl.getAsset(AssetSourceImpl.java:87)
> at $AssetSource_369c373aab0b9a.getAsset(Unknown Source)
> at 
> org.apache.tapestry5.internal.services.javascript.CoreJavaScriptStack.getJavaScriptLibraries(CoreJavaScriptStack.java:154)
> {quote}
> Here is a cache to prevent lock contention, but I'm not sure whether it works 
> properly.
> {code:title=AssetSourceImpl.java}
> private final Map> cache = new 
> WeakHashMap>();
> {code}
> Here the problem is that Resource is used as a key.
> So the cache entry will be removed as soon as key is available for garbage 
> collection.
> Resources aren't always long-lived objects.
> For example resources produced by AssetSourceImpl.findResource(Resource 
> baseResource, String path) has a very short lifecycle.
> It would be good to use SoftHashMap instead of WeakHashMap here, but it is 
> not included in standard Java.
> To check my assumption I created cache based on ConcurrentHashMap instead of 
> WeakHashMap. As result of it lock contention disappeared and overall 
> performance increased.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-2336) Lock contention in AssetSourceImp

2014-08-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082831#comment-14082831
 ] 

ASF subversion and git services commented on TAP5-2336:
---

Commit 7e710abee2dc00d73149ba301c80af5f5df8269d in tapestry-5's branch 
refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=7e710ab ]

TAP5-2336: Trade some memory to remove lock contention resolving resources on 
the classpath


> Lock contention in AssetSourceImp
> -
>
> Key: TAP5-2336
> URL: https://issues.apache.org/jira/browse/TAP5-2336
> Project: Tapestry 5
>  Issue Type: Improvement
>Reporter: Michael Mikhulya
>  Labels: performance
> Fix For: 5.4
>
>
> While benchmarking tapestry framework with concurency level = 4 I found lock 
> contention in AssetSourceImpl.java.
> Lock looks as follows:
> {quote}
> java.lang.Thread.State: BLOCKED (on object monitor)
> at java.util.zip.ZipFile.getEntry(ZipFile.java:304)
> - locked <0x000711ee6800> (a java.util.jar.JarFile)
> at java.util.jar.JarFile.getEntry(JarFile.java:226)
> at java.util.jar.JarFile.getJarEntry(JarFile.java:209)
> at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:840)
> at sun.misc.URLClassPath$JarLoader.findResource(URLClassPath.java:818)
> at sun.misc.URLClassPath.findResource(URLClassPath.java:176)
> at java.net.URLClassLoader$2.run(URLClassLoader.java:551)
> at java.net.URLClassLoader$2.run(URLClassLoader.java:549)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findResource(URLClassLoader.java:548)
> at java.lang.ClassLoader.getResource(ClassLoader.java:1139)
> at java.lang.ClassLoader.getResource(ClassLoader.java:1134)
> at 
> org.apache.catalina.loader.WebappClassLoader.getResource(WebappClassLoader.java:1417)
> at 
> org.apache.tapestry5.ioc.internal.util.ClasspathResource.resolveURL(ClasspathResource.java:79)
> at 
> org.apache.tapestry5.ioc.internal.util.ClasspathResource.toURL(ClasspathResource.java:61)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.computeExists(AbstractResource.java:236)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.exists(AbstractResource.java:218)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.findLocalizedResource(AbstractResource.java:177)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.populateLocalizationCache(AbstractResource.java:159)
> at 
> org.apache.tapestry5.ioc.internal.util.AbstractResource.forLocale(AbstractResource.java:136)
> at 
> org.apache.tapestry5.internal.services.AssetSourceImpl.getLocalizedAssetFromResource(AssetSourceImpl.java:134)
> at 
> org.apache.tapestry5.internal.services.AssetSourceImpl.getAssetInLocale(AssetSourceImpl.java:107)
> at 
> org.apache.tapestry5.internal.services.AssetSourceImpl.getAsset(AssetSourceImpl.java:87)
> at $AssetSource_369c373aab0b9a.getAsset(Unknown Source)
> at 
> org.apache.tapestry5.internal.services.javascript.CoreJavaScriptStack.getJavaScriptLibraries(CoreJavaScriptStack.java:154)
> {quote}
> Here is a cache to prevent lock contention, but I'm not sure whether it works 
> properly.
> {code:title=AssetSourceImpl.java}
> private final Map> cache = new 
> WeakHashMap>();
> {code}
> Here the problem is that Resource is used as a key.
> So the cache entry will be removed as soon as key is available for garbage 
> collection.
> Resources aren't always long-lived objects.
> For example resources produced by AssetSourceImpl.findResource(Resource 
> baseResource, String path) has a very short lifecycle.
> It would be good to use SoftHashMap instead of WeakHashMap here, but it is 
> not included in standard Java.
> To check my assumption I created cache based on ConcurrentHashMap instead of 
> WeakHashMap. As result of it lock contention disappeared and overall 
> performance increased.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: TAP5-2335: Spot-optimization to the NamedSet collection

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master 7e710abee -> b0f280657


TAP5-2335: Spot-optimization to the NamedSet collection


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/b0f28065
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/b0f28065
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/b0f28065

Branch: refs/heads/master
Commit: b0f280657b939fb1efb91cfc4c7d6e2560df19fc
Parents: 7e710ab
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 12:52:46 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 12:52:46 2014 -0700

--
 .../org/apache/tapestry5/internal/util/NamedSet.java   | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/b0f28065/tapestry-core/src/main/java/org/apache/tapestry5/internal/util/NamedSet.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/util/NamedSet.java 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/util/NamedSet.java
index 642968f..301954c 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/util/NamedSet.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/util/NamedSet.java
@@ -1,5 +1,3 @@
-// Copyright 2011, 2012 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
@@ -21,6 +19,7 @@ import 
org.apache.tapestry5.ioc.internal.util.CollectionFactory;
 import org.apache.tapestry5.ioc.internal.util.InternalUtils;
 import org.apache.tapestry5.ioc.internal.util.LockSupport;
 
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Set;
 import java.util.concurrent.locks.ReadWriteLock;
@@ -87,7 +86,12 @@ public class NamedSet extends LockSupport
 public Set getValues()
 {
 Set result = CollectionFactory.newSet();
+addValues(result);
+return result;
+}
 
+private void addValues(Collection result)
+{
 try
 {
 acquireReadLock();
@@ -100,7 +104,6 @@ public class NamedSet extends LockSupport
 cursor = cursor.next;
 }
 
-return result;
 } finally
 {
 releaseReadLock();
@@ -197,7 +200,9 @@ public class NamedSet extends LockSupport
  */
 public void eachValue(Worker worker)
 {
-F.flow(getValues()).each(worker);
+Collection result = CollectionFactory.newList();
+addValues(result);
+F.flow(result).each(worker);
 }
 
 



[jira] [Closed] (TAP5-2335) Decrease number of operations with HashMap #2

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2335.
--

   Resolution: Fixed
Fix Version/s: 5.4
 Assignee: Howard M. Lewis Ship

> Decrease number of operations with HashMap #2
> -
>
> Key: TAP5-2335
> URL: https://issues.apache.org/jira/browse/TAP5-2335
> Project: Tapestry 5
>  Issue Type: Improvement
>Reporter: Michael Mikhulya
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
> Attachments: 
> 0001-TAP5-2335-Decrease-number-of-operations-with-HashMap.patch
>
>
> During profiling of tapestry framework I found that HashMap is actively used 
> in following code:
> {code:title=NamedSet.java}
> public void eachValue(Worker worker)
> {
> F.flow(getValues()).each(worker);
> }
> {code}
> Here HashSet (which internally uses HashMap) is created inside getValues() 
> only to iterate over it.
> I changed code to use ArrayList instead of HashSet.
> With following patch time per request decreased on 3.5 ms (7.4% of overall 
> time). Measurements were done with apache benchmark on a real application 
> after warm up phase.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-2335) Decrease number of operations with HashMap #2

2014-08-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082839#comment-14082839
 ] 

ASF subversion and git services commented on TAP5-2335:
---

Commit b0f280657b939fb1efb91cfc4c7d6e2560df19fc in tapestry-5's branch 
refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=b0f2806 ]

TAP5-2335: Spot-optimization to the NamedSet collection


> Decrease number of operations with HashMap #2
> -
>
> Key: TAP5-2335
> URL: https://issues.apache.org/jira/browse/TAP5-2335
> Project: Tapestry 5
>  Issue Type: Improvement
>Reporter: Michael Mikhulya
>Assignee: Howard M. Lewis Ship
> Fix For: 5.4
>
> Attachments: 
> 0001-TAP5-2335-Decrease-number-of-operations-with-HashMap.patch
>
>
> During profiling of tapestry framework I found that HashMap is actively used 
> in following code:
> {code:title=NamedSet.java}
> public void eachValue(Worker worker)
> {
> F.flow(getValues()).each(worker);
> }
> {code}
> Here HashSet (which internally uses HashMap) is created inside getValues() 
> only to iterate over it.
> I changed code to use ArrayList instead of HashSet.
> With following patch time per request decreased on 3.5 ms (7.4% of overall 
> time). Measurements were done with apache benchmark on a real application 
> after warm up phase.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: TAP-2334: Optimizations to PerThreadManager

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master b0f280657 -> 6e210b275


TAP-2334: Optimizations to PerThreadManager


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/6e210b27
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/6e210b27
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/6e210b27

Branch: refs/heads/master
Commit: 6e210b27558eaf9e3be8678954ee196b3d26202b
Parents: b0f2806
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 12:59:59 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 12:59:59 2014 -0700

--
 .../services/PerThreadServiceCreator.java   | 50 -
 .../services/PerThreadServiceLifecycle.java |  4 +-
 .../internal/services/PerthreadManagerImpl.java | 58 +++-
 .../ioc/services/PerthreadManager.java  | 13 -
 4 files changed, 55 insertions(+), 70 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6e210b27/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceCreator.java
--
diff --git 
a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceCreator.java
 
b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceCreator.java
deleted file mode 100644
index 44b0d0f..000
--- 
a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceCreator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2006, 2008, 2010 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.tapestry5.ioc.internal.services;
-
-import org.apache.tapestry5.ioc.ObjectCreator;
-import org.apache.tapestry5.ioc.services.PerThreadValue;
-import org.apache.tapestry5.ioc.services.PerthreadManager;
-
-/**
- * Provides per-thread implementations of services.
- */
-public class PerThreadServiceCreator implements ObjectCreator
-{
-private final PerThreadValue perThreadValue;
-
-private final ObjectCreator delegate;
-
-public PerThreadServiceCreator(PerthreadManager perthreadManager, 
ObjectCreator delegate)
-{
-perThreadValue = perthreadManager.createValue();
-
-this.delegate = delegate;
-}
-
-/**
- * For each thread, the first call will use the delegate {@link 
org.apache.tapestry5.ioc.ObjectCreator} to create
- * an instance, and later calls will reuse the same per-thread instance. 
The instance is stored in the
- * {@link org.apache.tapestry5.ioc.services.PerthreadManager} and will be 
released at the end of the request.
- */
-@Override
-public Object createObject()
-{
-if (perThreadValue.exists())
-return perThreadValue.get();
-
-return perThreadValue.set(delegate.createObject());
-}
-}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6e210b27/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceLifecycle.java
--
diff --git 
a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceLifecycle.java
 
b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceLifecycle.java
index 118cb44..f9017c2 100644
--- 
a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceLifecycle.java
+++ 
b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerThreadServiceLifecycle.java
@@ -1,5 +1,3 @@
-// Copyright 2006, 2007, 2008, 2009, 2010, 2011 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
@@ -58,7 +56,7 @@ public class PerThreadServiceLifecycle implements 
ServiceLifecycle
 @Override
 public Object createService(ServiceResources resources, ObjectCreator 
creator)
 {
-ObjectCreator perThreadCreator = new 
PerThreadServiceCreator(perthreadManager, creator);
+ObjectCreator perThreadCreator = perthreadManager.createValue(creator);
 
 Class serviceInterface = resou

[jira] [Closed] (TAP5-2334) Decrease number of operations with HashMap #1

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2334.
--

   Resolution: Fixed
Fix Version/s: 5.4
 Assignee: Howard M. Lewis Ship

> Decrease number of operations with HashMap #1
> -
>
> Key: TAP5-2334
> URL: https://issues.apache.org/jira/browse/TAP5-2334
> Project: Tapestry 5
>  Issue Type: Improvement
>Reporter: Michael Mikhulya
>Assignee: Howard M. Lewis Ship
>  Labels: performance
> Fix For: 5.4
>
> Attachments: 
> 0001-TAP5-2334-Decrease-number-of-operations-with-HashMap.patch
>
>
> During profiling I found that there is a lot of work with HashMap inside 
> tapestry framework.
> With following patch time per request decreased on 2.2ms (4.6% of overall 
> time). Measurements were done with apache benchmark on a real application 
> after warm up phase.
> The idea behind the patch is to get rid of double lookup inside HashMap (or 
> event triple lookup) whenever only one lookup is enough.
> Also this patch decrease number of ThreadLocal.get calls in two times by 
> moving PerThreadServiceCreator functionality into PerthreadManager.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-2333) Decrease number of ThreadLocal.get calls

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082844#comment-14082844
 ] 

Howard M. Lewis Ship commented on TAP5-2333:


This one I need to think about more; getting that operation trace data is very 
compelling to me, especially in production where other means may be 
unavailable. I'll start a discussion on the mailing list.

> Decrease number of ThreadLocal.get calls
> 
>
> Key: TAP5-2333
> URL: https://issues.apache.org/jira/browse/TAP5-2333
> Project: Tapestry 5
>  Issue Type: Improvement
>Reporter: Michael Mikhulya
>  Labels: performance
> Attachments: 
> 0001-TAP5-2333-Decrease-number-of-ThreadLocal.get-calls.patch, 
> 0002-TAP5-2333-Decrease-number-of-ThreadLocal.get-calls.patch, 
> 0003-TAP5-2333-Decrease-number-of-ThreadLocal.get-calls.patch
>
>
> During profiling I found that ThreadLocal.get is a very hot method call.
> Most frequently it is called from PerThreadOperationTracker.
> PerThreadOperationTracker can be replaced with SimpleOperationTracker which I 
> introduced in a patch.
> SimpleOperationTracker only prints exception without "operations trace".
> "Operations trace" can be useful during debug. So in my patch 
> PerThreadOperationTracker is used in debug mode, but otherwise 
> SimpleOperationTracker is used.
> Please check whether this decision is good for most cases.
> Performance gains are very serious. 
> Time per request decreased on 11ms (23% of overall time).
> All measurements are done with apache benchmark after warm up phase.
> Currently my patch breaks two tests:
> CoreBehaviorsTests. event_handler_return_types
> MiscTests. operation_tracking_via_annotation
> Both tests are broken because tests depend on 'Operation description' which 
> is ignored by SimpleOperationTracker.
> The simplest way to fix tests is to enforce using PerThreadOperationTracker 
> for these tests.
> I'm not sure whether 'Operation description' is definitely useful especially 
> taking into account that only 2 tests become broken. We use 
> SimpleOperationTracker on production for several months already and nobody 
> notice that 'Operation descriptions' are absent. In all cases (for us) it was 
> enough to see a stack trace of exception in logs.
> See TAP5-2332. There is a huge amount of String.format required to track such 
> 'operation descriptions'. By removing calculation of such 'operation 
> descriptions' Tapestry can be made much faster.
> If 'Operation descriptions' is required for some cases than we can introduce 
> some option to enable/disable this feature.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (TAP5-2365) PlasticUtilsTests."Do not urlencode file paths" fails when using openjdk7

2014-08-01 Thread Felix Scheffer (JIRA)
Felix Scheffer created TAP5-2365:


 Summary: PlasticUtilsTests."Do not urlencode file paths" fails 
when using openjdk7
 Key: TAP5-2365
 URL: https://issues.apache.org/jira/browse/TAP5-2365
 Project: Tapestry 5
  Issue Type: Bug
  Components: plastic
Affects Versions: 5.4
Reporter: Felix Scheffer


PlasticUtilsTests."Do not urlencode file paths" fails on Ubuntu 14.04 (using 
openjdk7):

{code}
java.lang.IllegalArgumentException: URI is not hierarchical
at java.io.File.(File.java:418)
at org.apache.tapestry5.internal.plastic.PlasticUtilsTests.Do not 
urlencode file paths(PlasticUtilsTests.groovy:28)
{code}

getClass().getClassLoader().getResource(".") returns 
"jar:file:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/pulse-java.jar!/" which 
is obvisiouly not the expected result. 

I am not sure but I think pulse-java.jar was not part of openjdk6 in ealier 
versions of Ubuntu. Removing pulse-java.jar solves the problem but I dont think 
that's a good solution.

I think there are two issues here:
a) There's something wrong with pulse-java.jar even though I have absolutely no 
clue what it is.
b) Calling getResource(".") looks like a hack to me. "." is not a real resource.

For more information on this issue:
- 
http://stackoverflow.com/questions/16317789/thread-currentthread-getcontextclassloader-getresource-has-different-re
- 
http://stackoverflow.com/questions/13901540/how-to-get-location-of-runnable-jar-file-when-run-from-gnome



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[2/2] git commit: Update to docco 0.6.3

2014-08-01 Thread hlship
Update to docco 0.6.3


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/b8391899
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/b8391899
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/b8391899

Branch: refs/heads/master
Commit: b83918998ebda8a30c6c48e7679ba12e0ab80e39
Parents: db4f62a
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 14:45:42 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 14:45:42 2014 -0700

--
 build.gradle | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/b8391899/build.gradle
--
diff --git a/build.gradle b/build.gradle
index f523c87..7d0b5c5 100755
--- a/build.gradle
+++ b/build.gradle
@@ -365,8 +365,6 @@ task coffeeScriptDocs(type: Exec) {
 
 def outputDir = file("$buildDir/documentation/coffeescript")
 
-// Note: this currently does not include the results of preprocessing the 
t5/core/dom.coffee file
-
 def sources = files()
 
 subprojects.each { sub ->
@@ -375,15 +373,10 @@ task coffeeScriptDocs(type: Exec) {
 
 sources += 
project(":tapestry-core").tasks.preprocessCoffeeScript.outputs.files.asFileTree
 
-logger.error "sources=$sources"
-
-// Needs to be installed via "npm install -g docco"
+// Needs to be installed via "npm install -g docco@0.6.3"
 executable isWindows() ? "docco.cmd" : "docco"
 args "--output", outputDir
 args sources.files.sort({ a, b -> a.name.compareTo b.name })
-
-inputs.files { sources }
-outputs.dir outputDir
 }
 
 



[1/2] git commit: Get the version number into multiple places in the JavaDocs

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master 6e210b275 -> b83918998


Get the version number into multiple places in the JavaDocs


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/db4f62a6
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/db4f62a6
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/db4f62a6

Branch: refs/heads/master
Commit: db4f62a6f2bd2cbf9cb78b538d035671e358850e
Parents: 6e210b2
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 13:17:59 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 13:17:59 2014 -0700

--
 build.gradle | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/db4f62a6/build.gradle
--
diff --git a/build.gradle b/build.gradle
index 19aa893..f523c87 100755
--- a/build.gradle
+++ b/build.gradle
@@ -316,9 +316,10 @@ task aggregateJavadoc(type: Javadoc) {
 splitIndex true
 linkSource true
 stylesheetFile tapestryStylesheet
-windowTitle "Tapestry API Documentation"
-docTitle "Tapestry JavaDoc ($project.version)"
-bottom 'Copyright © 2003-2013 http://tapestry.apache.org";>The Apache Software Foundation.'
+windowTitle "Tapestry API - ${project.version}"
+header "Tapestry API - ${project.version}"
+docTitle "Tapestry API - ($project.version)"
+bottom '${project.version} - Copyright © 2003-2014 http://tapestry.apache.org";>The Apache Software Foundation.'
 use = true // 'use' seems to be a reserved word for the DSL
 links "http://download.oracle.com/javase/6/docs/api/";
 links "http://download.oracle.com/javaee/6/api/";



[jira] [Commented] (TAP5-2350) JavaScript library with module shim config is loaded twice if module is added to a stack

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14083012#comment-14083012
 ] 

Howard M. Lewis Ship commented on TAP5-2350:


I'm having trouble picturing this, do you have some code?

> JavaScript library with module shim config is loaded twice if module is added 
> to a stack
> 
>
> Key: TAP5-2350
> URL: https://issues.apache.org/jira/browse/TAP5-2350
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Jochen Kemnade
>  Labels: javascript, stack
>
> When a shim config is defined for a JavaScript library and the resulting 
> "module" is added to a JavaScript stack, the raw library will be added to the 
> stack resource (without a define statement). But under normal circumstances, 
> it will never be used as it is added without any module wrapper code.
> When the library is required (via the shim module) from another module, 
> requirejs loads it again.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-2269) Client persist doesn't work on single object field

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2269.
--

Resolution: Incomplete

You need to provide more details:

What was rendered as the URL, what was in the request.  You say it "didn't 
work" is that an exception, a missing or incorrect value?  Is this because you 
opened another window? More details please, then re-open.

> Client persist doesn't work on single object field
> --
>
> Key: TAP5-2269
> URL: https://issues.apache.org/jira/browse/TAP5-2269
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.7
>Reporter: Rural Hunter
>
> Page:
> public class test {
>   @Property 
>   @Persist(PersistenceConstants.CLIENT)
>   Box u ;//any object here
>   
>   @Property
>   @Persist(PersistenceConstants.CLIENT)
>   private String title;
>   
>   public void setUpRender(){
>   if(u==null)
>   u = new Box();
>   }
>   
>   public void onSubmitFromTeast(){
>   System.out.println("Submitted value="+u.getType());
>   }
> }
> tml:
> http://tapestry.apache.org/schema/tapestry_5_3.xsd"; 
> xmlns="http://www.w3.org/1999/xhtml";   xmlns:p="tapestry:parameter">
> 
> 
> test
> 
>  t:clientId="utype"/>
> 
> 
> 
> 
> 
> 
> Entity(The problem is not related to any particular entity. this can be any 
> entity here):
> public class Box implements Serializable
> {
> public Long id;
> public String type;
> }
> In the test above, the persist doesn't work on Box object. If I just 
> uncomment the 'title' textfield in tml, the persist on Box will be 
> successful. 
> I had a rough investigation and found 
> ClientPersistentFieldStorageImpl.postChange was not triggered without the 
> 'title' field.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: Update Clojure to 1.6.0

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master b83918998 -> 25389db3c


Update Clojure to 1.6.0


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/25389db3
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/25389db3
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/25389db3

Branch: refs/heads/master
Commit: 25389db3c39946f39bbe4e6ce8d09c7e24ded581
Parents: b839189
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 15:04:37 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 15:04:37 2014 -0700

--
 tapestry-clojure/build.gradle |  2 +-
 .../internal/clojure/ClojureBuilderImpl.java  | 18 --
 2 files changed, 9 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/25389db3/tapestry-clojure/build.gradle
--
diff --git a/tapestry-clojure/build.gradle b/tapestry-clojure/build.gradle
index 2366a91..77111c6 100644
--- a/tapestry-clojure/build.gradle
+++ b/tapestry-clojure/build.gradle
@@ -2,7 +2,7 @@ description = "Allows Clojure functions to be injected into 
Tapestry services an
 
 dependencies {
   compile project(':tapestry-ioc')
-  compile "org.clojure:clojure:1.5.1"
+  compile "org.clojure:clojure:1.6.0"
 
   // Added just to prove that it works (TAP5-1945)
   testCompile project(':tapestry-core')

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/25389db3/tapestry-clojure/src/main/java/org/apache/tapestry5/internal/clojure/ClojureBuilderImpl.java
--
diff --git 
a/tapestry-clojure/src/main/java/org/apache/tapestry5/internal/clojure/ClojureBuilderImpl.java
 
b/tapestry-clojure/src/main/java/org/apache/tapestry5/internal/clojure/ClojureBuilderImpl.java
index 1d6184a..2e42946 100644
--- 
a/tapestry-clojure/src/main/java/org/apache/tapestry5/internal/clojure/ClojureBuilderImpl.java
+++ 
b/tapestry-clojure/src/main/java/org/apache/tapestry5/internal/clojure/ClojureBuilderImpl.java
@@ -1,5 +1,3 @@
-// Copyright 2012-2013 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
@@ -14,10 +12,9 @@
 
 package org.apache.tapestry5.internal.clojure;
 
+import clojure.java.api.Clojure;
 import clojure.lang.IFn;
-import clojure.lang.RT;
 import clojure.lang.Symbol;
-import clojure.lang.Var;
 import org.apache.tapestry5.clojure.ClojureBuilder;
 import org.apache.tapestry5.clojure.MethodToFunctionSymbolMapper;
 import org.apache.tapestry5.clojure.Namespace;
@@ -37,7 +34,7 @@ public class ClojureBuilderImpl implements ClojureBuilder
 
 private final OperationTracker tracker;
 
-private final Var REQUIRE = RT.var("clojure.core", "require");
+private final IFn REQUIRE = Clojure.var("clojure.core", "require");
 
 public ClojureBuilderImpl(@Builtin PlasticProxyFactory proxyFactory, 
MethodToFunctionSymbolMapper mapper, OperationTracker tracker)
 {
@@ -93,20 +90,21 @@ public class ClojureBuilderImpl implements ClojureBuilder
 @Override
 public void run()
 {
+
 Symbol namespaceSymbol = 
Symbol.create(symbol.getNamespace());
 
 REQUIRE.invoke(namespaceSymbol);
 
-Var var = Var.find(symbol);
+IFn clojureFunction = Clojure.var(symbol);
 
-final PlasticField varField = 
plasticClass.introduceField(Var.class, method.getName() + "Var").inject(var);
+final PlasticField fnField = 
plasticClass.introduceField(IFn.class, method.getName() + 
"IFn").inject(clojureFunction);
 
 
plasticClass.introduceMethod(desc).changeImplementation(new 
InstructionBuilderCallback()
 {
 @Override
 public void doBuild(InstructionBuilder builder)
 {
-bridgeToClojure(builder, desc, varField);
+bridgeToClojure(builder, desc, fnField);
 }
 });
 
@@ -115,9 +113,9 @@ public class ClojureBuilderImpl implements ClojureBuilder
 
 }
 
-private void bridgeToClojure(InstructionBuilder builder, 
MethodDescription description, PlasticField varField)
+private void bridgeToClojure(InstructionBuilder builder, 
MethodDescription description, PlasticField ifnField)
 {
-builder.loadThis().getField(varField);
+   

[jira] [Closed] (TAP5-1973) :443 added to URLs when using the Link.toAbsoluteURI(true)

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-1973.
--

Resolution: Fixed

I'm not sure why you re-opened this. At least in the 5.4 code it looks good. 
5.3 code is identical.

> :443 added to URLs when using the Link.toAbsoluteURI(true)
> --
>
> Key: TAP5-1973
> URL: https://issues.apache.org/jira/browse/TAP5-1973
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.4, 5.4
>Reporter: Howard M. Lewis Ship
>Assignee: Kalle Korhonen
>  Labels: fixed-in-5.4-js-rewrite
> Fix For: 5.4, 5.3.5
>
>
> An error in the code means that when secure is true and the port is set to 
> 443, then ":443" is appended:
> int port = secure ? secureHostPort : hostPort;
> String portSuffix = "";
> if (port <= 0) { 
> port = request.getServerPort();
> int schemeDefaultPort = request.isSecure() ? 443 : 80;
> portSuffix = port == schemeDefaultPort ? "" : ":" + port;
> }
> else if (secure && port != 443) portSuffix = ":" + port;
> else if (port != 80) portSuffix = ":" + port;
> 
> String hostname = "".equals(this.hostname) ? request.getServerName() 
> : this.hostname.startsWith("$") ? System.getenv(this.hostname.substring(1)) : 
> this.hostname;
> 
> return String.format("%s://%s%s", secure ? "https" : "http", 
> hostname, portSuffix);
> secure == true && port != 443 is false, so
> port != 80 is evaluated, it true, so
> ":443" is appended.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: TAP5-1900: Provide better control over Response character set, using value specified in Request if possible

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master 25389db3c -> d29d6dc59


TAP5-1900: Provide better control over Response character set, using value 
specified in Request if possible


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/d29d6dc5
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/d29d6dc5
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/d29d6dc5

Branch: refs/heads/master
Commit: d29d6dc59df407f2f9f1b0adbdcd25bb4a3dc775
Parents: 25389db
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 15:29:05 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 15:29:05 2014 -0700

--
 .../tapestry5/internal/services/RequestImpl.java  | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d29d6dc5/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestImpl.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestImpl.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestImpl.java
index c62027a..1219f9b 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestImpl.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestImpl.java
@@ -39,7 +39,7 @@ public class RequestImpl implements Request
 
 private final HttpServletRequest request;
 
-private final String requestEncoding;
+private final String applicationCharset;
 
 private final TapestrySessionFactory sessionFactory;
 
@@ -49,11 +49,11 @@ public class RequestImpl implements Request
 
 public RequestImpl(
 HttpServletRequest request,
-String requestEncoding,
+String applicationCharset,
 TapestrySessionFactory sessionFactory)
 {
 this.request = request;
-this.requestEncoding = requestEncoding;
+this.applicationCharset = applicationCharset;
 this.sessionFactory = sessionFactory;
 }
 
@@ -147,8 +147,16 @@ public class RequestImpl implements Request
 private void setupEncoding()
 {
 if (encodingSet)
+{
 return;
+}
 
+// check if request specifies an encoding
+String requestEncoding =
+request.getCharacterEncoding() == null
+? applicationCharset
+: request.getCharacterEncoding();
+
 try
 {
 request.setCharacterEncoding(requestEncoding);



[jira] [Closed] (TAP5-1900) Tapestry always uses application charset for request encoding, should first check content-type header

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-1900.
--

Resolution: Fixed
  Assignee: Howard M. Lewis Ship

> Tapestry always uses application charset for request encoding, should first 
> check content-type header
> -
>
> Key: TAP5-1900
> URL: https://issues.apache.org/jira/browse/TAP5-1900
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5, 5.3.6
>Reporter: Nelson Rodrigues
>Assignee: Howard M. Lewis Ship
> Attachments: tap5-1900.patch
>
>
> I'm using Tapestry as a sort of REST server, using pages to act as REST 
> gateways to business services.
> To access those pages I'm using Spring's RestTemplate which as a default uses 
> ISO-8859-1 as the request encoding and properly seting the request's 
> content-type header.
> Tapestry currently forces the request encoding to be the same as the 
> application charset (see 
> org.apache.tapestry5.internal.services.RequestImpl.setupEncoding), I believe 
> it should first check the content-type header and use that value instead, 
> only using application charset as a fallback.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-1900) Tapestry always uses application charset for request encoding, should first check content-type header

2014-08-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-1900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14083078#comment-14083078
 ] 

ASF subversion and git services commented on TAP5-1900:
---

Commit d29d6dc59df407f2f9f1b0adbdcd25bb4a3dc775 in tapestry-5's branch 
refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=d29d6dc ]

TAP5-1900: Provide better control over Response character set, using value 
specified in Request if possible


> Tapestry always uses application charset for request encoding, should first 
> check content-type header
> -
>
> Key: TAP5-1900
> URL: https://issues.apache.org/jira/browse/TAP5-1900
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5, 5.3.6
>Reporter: Nelson Rodrigues
>Assignee: Howard M. Lewis Ship
> Attachments: tap5-1900.patch
>
>
> I'm using Tapestry as a sort of REST server, using pages to act as REST 
> gateways to business services.
> To access those pages I'm using Spring's RestTemplate which as a default uses 
> ISO-8859-1 as the request encoding and properly seting the request's 
> content-type header.
> Tapestry currently forces the request encoding to be the same as the 
> application charset (see 
> org.apache.tapestry5.internal.services.RequestImpl.setupEncoding), I believe 
> it should first check the content-type header and use that value instead, 
> only using application charset as a fallback.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-2166) Wrong layout of textfield with Autocomplete mixin

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2166.
--

Resolution: Incomplete

Please attach the screen shot with details about how the layout is wrong, and 
re-open.

> Wrong layout of textfield with Autocomplete mixin
> -
>
> Key: TAP5-2166
> URL: https://issues.apache.org/jira/browse/TAP5-2166
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Eugen
>Priority: Minor
>
> this code snippet produce an unexpected form layout:
>
>   
>   State
>   
>   
>   
>  Country
>t:mixins="autocomplete" />
>   
>  
> The label is on the same line with textfield, the textfield width is wrong 
> (screenshot http://imagesup.net/?di=913782968996)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-2241) The "filter frames" checkbox display in an iframe due to an Ajax request exception does not work

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2241?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2241.
--

Resolution: Cannot Reproduce

Perhaps this was true at one time, but is not currently the case.

> The "filter frames" checkbox display in an iframe due to an Ajax request 
> exception does not work
> 
>
> Key: TAP5-2241
> URL: https://issues.apache.org/jira/browse/TAP5-2241
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.4
>Reporter: Howard M. Lewis Ship
>Priority: Minor
>
> Probably due to how the iframe is constructed and loaded ... the JS in the 
> iframe may not be executing.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-2042) Favico url malformed when the page has a context in the request

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2042?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2042.
--

Resolution: Invalid

I suspect you have some  in your template that is wrong, for the client 
to expect the favicon URL to be what appears in your log. Fix that (use the 
asset: binding prefix, etc.).

> Favico url malformed when the page has a context in the request
> ---
>
> Key: TAP5-2042
> URL: https://issues.apache.org/jira/browse/TAP5-2042
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6
>Reporter: Matías Blasi
>Priority: Minor
>  Labels: activate, context, favicon
>
> When trying to acces to a page of my application "ticket/list" with a 
> context, like:
> http://localhost/ticket/list/1/8
> The page request is correctly processed, I get the page as expected, but, 
> there is a next request for the favico, with an incorrect url:
> Caused by: java.lang.NumberFormatException: For input string: "ico"
> at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> at java.lang.Long.parseLong(Long.java:438)
> at java.lang.Long.(Long.java:690)
> at 
> org.apache.tapestry5.ioc.services.TapestryIOCModule$9.coerce(TapestryIOCModule.java:241)
> at 
> org.apache.tapestry5.ioc.services.TapestryIOCModule$9.coerce(TapestryIOCModule.java:238)
> at 
> org.apache.tapestry5.ioc.services.CoercionTuple$CoercionWrapper.coerce(CoercionTuple.java:54)
> at 
> org.apache.tapestry5.ioc.internal.services.TypeCoercerImpl$TargetCoercion.coerce(TypeCoercerImpl.java:71)
> ... 87 more
> [INFO] ComexwebModule.TimingFilter Request time: 327 ms
> 0:0:0:0:0:0:0:1 -  -  [04/ene/2013:11:16:14 +] "GET 
> /ticket/list/1/ico/favicon.png HTTP/1.1" 500 4323 "-" "Mozilla/5.0 (X11; 
> Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.35 
> Safari/537.17"
> If I get the page with no activation context, everithing works fine.
> Regards,
> Matías.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: TAP5-2030: Allow blank values to bypass value encoder and go directly to null, if enabled by annotation

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master d29d6dc59 -> 5649174f0


TAP5-2030: Allow blank values to bypass value encoder and go directly to null, 
if enabled by annotation


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/5649174f
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/5649174f
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/5649174f

Branch: refs/heads/master
Commit: 5649174f0fc642bd01baf5dcc81958a48b636556
Parents: d29d6dc
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 16:26:43 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 16:26:43 2014 -0700

--
 54_RELEASE_NOTES.md |  9 -
 .../TypeCoercedValueEncoderFactory.java | 11 --
 .../internal/transform/OnEventWorker.java   | 32 ++---
 .../src/test/app1/RequestParameterDemo.tml  |  3 ++
 .../integration/app1/RequestParameterTests.java | 10 --
 .../app1/pages/RequestParameterDemo.java| 37 ++--
 6 files changed, 74 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5649174f/54_RELEASE_NOTES.md
--
diff --git a/54_RELEASE_NOTES.md b/54_RELEASE_NOTES.md
index 9161e0a..00e3dcb 100644
--- a/54_RELEASE_NOTES.md
+++ b/54_RELEASE_NOTES.md
@@ -418,4 +418,11 @@ where desired.
 
 ## Java 1.6 required
 
-As of version 5.4, Tapestry requires Java 1.6 at least.
\ No newline at end of file
+As of version 5.4, Tapestry requires Java 1.6 at least.
+
+## ValueEncoder Changes
+
+The automatic ValueEncoder from String to any Number type, or ti Boolean have
+changed slightly. An empty input string is encoded to a null rather than being 
passed through
+the type coercer. This reflects the desire that a submitted value (in a URL or 
a form) that is blank
+is the same as no value: null.

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5649174f/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/TypeCoercedValueEncoderFactory.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/TypeCoercedValueEncoderFactory.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/TypeCoercedValueEncoderFactory.java
index bee075d..9d67d87 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/TypeCoercedValueEncoderFactory.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/TypeCoercedValueEncoderFactory.java
@@ -1,5 +1,3 @@
-// Copyright 2008 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
@@ -15,6 +13,7 @@
 package org.apache.tapestry5.internal.services;
 
 import org.apache.tapestry5.ValueEncoder;
+import org.apache.tapestry5.ioc.internal.util.InternalUtils;
 import org.apache.tapestry5.ioc.services.TypeCoercer;
 import org.apache.tapestry5.services.ValueEncoderFactory;
 
@@ -33,6 +32,10 @@ public class TypeCoercedValueEncoderFactory implements 
ValueEncoderFactory create(final Class type)
 {
+final boolean blankToNull =
+Boolean.class.isAssignableFrom(type) ||
+Number.class.isAssignableFrom(type);
+
 return new ValueEncoder()
 {
 public String toClient(Object value)
@@ -42,6 +45,10 @@ public class TypeCoercedValueEncoderFactory implements 
ValueEncoderFactoryhttp://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5649174f/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/OnEventWorker.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/OnEventWorker.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/OnEventWorker.java
index 9a4a92d..c640158 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/OnEventWorker.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/OnEventWorker.java
@@ -1,4 +1,3 @@
-// Copyright 2006-2013 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
@@ -432,35 +431,36 @@ public class OnEventWorker implements 
ComponentClassTransformWorker2
 {
 try
 {
-
+
 Class parameterType = 
classCache.forName(parameterTypeName);
  

[jira] [Commented] (TAP5-2030) @RequestParameter with Long fails with blank values even if allowBlank = true

2014-08-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14083174#comment-14083174
 ] 

ASF subversion and git services commented on TAP5-2030:
---

Commit 5649174f0fc642bd01baf5dcc81958a48b636556 in tapestry-5's branch 
refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=5649174 ]

TAP5-2030: Allow blank values to bypass value encoder and go directly to null, 
if enabled by annotation


> @RequestParameter with Long fails with blank values even if allowBlank = true
> -
>
> Key: TAP5-2030
> URL: https://issues.apache.org/jira/browse/TAP5-2030
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6
>Reporter: DI Florian Hackenberger
>Assignee: Howard M. Lewis Ship
>Priority: Minor
> Fix For: 5.4
>
>
> The fix could either be done in the type coercer for the object wrappers for 
> numbers in TapestryIOCModule#provideBasicTypeCoercions
> which could return null if the input string is empty, or in 
> OnEventWorker#createQueryParameterProvider which could handle the exception 
> thrown on line 448 in 
> Object value = valueEncoder.toValue(parameterValue);
> Here is the stacktrace for the error:
> org.apache.tapestry5.runtime.ComponentEventException: Unable process query 
> parameter 'guestGroupId' as parameter #1 of event handler method 
> org.acoveo.topfive.frontend.components.Layout.openGuestGroup(java.lang.Long): 
> Coercion of  to type java.lang.Long (via String --> Long) failed: For input 
> string: ""
>   at 
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1136)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$3100(ComponentPageElementImpl.java:61)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1057)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1054)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124) 
> ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.structure.ComponentPageElementResourcesImpl.invoke(ComponentPageElementResourcesImpl.java:146)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1053)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:110)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.services.ajax.AjaxFormUpdateFilter.handle(AjaxFormUpdateFilter.java:56)
>  ~[tapestry-core-5.3.6.jar:na]
>   at $ComponentEventRequestHandler_b5c7a34926c8.handle(Unknown Source) 
> ~[na:na]
>   at $ComponentEventRequestHandler_b5c7a34926c0.handle(Unknown Source) 
> ~[na:na]
>   at 
> org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42) 
> ~[tapestry-core-5.3.6.jar:na]
>   at $ComponentEventRequestHandler_b5c7a34926c2.handle(Unknown Source) 
> ~[na:na]
>   at 
> org.apache.tapestry5.upload.internal.services.UploadExceptionFilter.handle(UploadExceptionFilter.java:75)
>  ~[tapestry-upload-5.3.6.jar:na]
>   at $ComponentEventRequestHandler_b5c7a34926c2.handle(Unknown Source) 
> ~[na:na]
>   at 
> org.apache.tapestry5.services.TapestryModule$41.handle(TapestryModule.java:2476)
>  ~[tapestry-core-5.3.6.jar:na]
>   at $ComponentEventRequestHandler_b5c7a34926c2.handle(Unknown Source) 
> ~[na:na]
>   at $ComponentEventRequestHandler_b5c7a349230c.handle(Unknown Source) 
> ~[na:na]
>   at 
> org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.services.InitializeActivePageName.handleComponentEvent(InitializeActivePageName.java:39)
>  ~[tapestry-core-5.3.6.jar:na]
>   at $ComponentRequestHandler_b5c7a349230e.handleComponentEvent(Unknown 
> Source) ~[na:na]
>   at $ComponentRequestHandler_b5c7a34922d8.handleComponentEvent(Unkno

[jira] [Closed] (TAP5-2030) @RequestParameter with Long fails with blank values even if allowBlank = true

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-2030.
--

   Resolution: Fixed
Fix Version/s: 5.4
 Assignee: Howard M. Lewis Ship

> @RequestParameter with Long fails with blank values even if allowBlank = true
> -
>
> Key: TAP5-2030
> URL: https://issues.apache.org/jira/browse/TAP5-2030
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6
>Reporter: DI Florian Hackenberger
>Assignee: Howard M. Lewis Ship
>Priority: Minor
> Fix For: 5.4
>
>
> The fix could either be done in the type coercer for the object wrappers for 
> numbers in TapestryIOCModule#provideBasicTypeCoercions
> which could return null if the input string is empty, or in 
> OnEventWorker#createQueryParameterProvider which could handle the exception 
> thrown on line 448 in 
> Object value = valueEncoder.toValue(parameterValue);
> Here is the stacktrace for the error:
> org.apache.tapestry5.runtime.ComponentEventException: Unable process query 
> parameter 'guestGroupId' as parameter #1 of event handler method 
> org.acoveo.topfive.frontend.components.Layout.openGuestGroup(java.lang.Long): 
> Coercion of  to type java.lang.Long (via String --> Long) failed: For input 
> string: ""
>   at 
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1136)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$3100(ComponentPageElementImpl.java:61)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1057)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl$5.invoke(ComponentPageElementImpl.java:1054)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124) 
> ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.structure.ComponentPageElementResourcesImpl.invoke(ComponentPageElementResourcesImpl.java:146)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1053)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:110)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.services.ajax.AjaxFormUpdateFilter.handle(AjaxFormUpdateFilter.java:56)
>  ~[tapestry-core-5.3.6.jar:na]
>   at $ComponentEventRequestHandler_b5c7a34926c8.handle(Unknown Source) 
> ~[na:na]
>   at $ComponentEventRequestHandler_b5c7a34926c0.handle(Unknown Source) 
> ~[na:na]
>   at 
> org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42) 
> ~[tapestry-core-5.3.6.jar:na]
>   at $ComponentEventRequestHandler_b5c7a34926c2.handle(Unknown Source) 
> ~[na:na]
>   at 
> org.apache.tapestry5.upload.internal.services.UploadExceptionFilter.handle(UploadExceptionFilter.java:75)
>  ~[tapestry-upload-5.3.6.jar:na]
>   at $ComponentEventRequestHandler_b5c7a34926c2.handle(Unknown Source) 
> ~[na:na]
>   at 
> org.apache.tapestry5.services.TapestryModule$41.handle(TapestryModule.java:2476)
>  ~[tapestry-core-5.3.6.jar:na]
>   at $ComponentEventRequestHandler_b5c7a34926c2.handle(Unknown Source) 
> ~[na:na]
>   at $ComponentEventRequestHandler_b5c7a349230c.handle(Unknown Source) 
> ~[na:na]
>   at 
> org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43)
>  ~[tapestry-core-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.services.InitializeActivePageName.handleComponentEvent(InitializeActivePageName.java:39)
>  ~[tapestry-core-5.3.6.jar:na]
>   at $ComponentRequestHandler_b5c7a349230e.handleComponentEvent(Unknown 
> Source) ~[na:na]
>   at $ComponentRequestHandler_b5c7a34922d8.handleComponentEvent(Unknown 
> Source) ~[na:na]
>   at 
> org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:46)
>  ~[tapestry-core-5.3.6.jar:na]
>   at $Dispatcher_b5c7a34922de.dispatch(Unknown Source) ~[na:na]
>   at $Dispatcher_b5c7a3

[1/2] git commit: Remove unused variable

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master 5649174f0 -> a29d1ea93


Remove unused variable


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/5b6e7c14
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/5b6e7c14
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/5b6e7c14

Branch: refs/heads/master
Commit: 5b6e7c14f5102aa8fee2c06318fa5eacb6c93b59
Parents: 5649174
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 16:28:04 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 16:28:04 2014 -0700

--
 .../org/apache/tapestry5/internal/services/RequestImplTest.java   | 3 ---
 1 file changed, 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5b6e7c14/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestImplTest.java
--
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestImplTest.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestImplTest.java
index 4ec0551..6613d7d 100644
--- 
a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestImplTest.java
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestImplTest.java
@@ -1,5 +1,3 @@
-// Copyright 2006-2013 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
@@ -51,7 +49,6 @@ public class RequestImplTest extends InternalBaseTestCase
 public void force_session_create()
 {
 HttpServletRequest sr = mockHttpServletRequest();
-HttpSession ss = mockHttpSession();
 TapestrySessionFactory sf = newMock(TapestrySessionFactory.class);
 Session session = mockSession();
 



[2/2] git commit: TAP5-1900: Provide better control over Response character set, using value specified in Request if possible

2014-08-01 Thread hlship
TAP5-1900: Provide better control over Response character set, using value 
specified in Request if possible


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/a29d1ea9
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/a29d1ea9
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/a29d1ea9

Branch: refs/heads/master
Commit: a29d1ea936802ec2f7a0494afbc2ac63fc0ae8c7
Parents: 5b6e7c1
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 16:35:03 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 16:35:03 2014 -0700

--
 .../internal/services/RequestImpl.java  | 15 ++
 .../internal/services/RequestImplTest.java  | 21 
 2 files changed, 27 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/a29d1ea9/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestImpl.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestImpl.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestImpl.java
index 1219f9b..6226e86 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestImpl.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestImpl.java
@@ -1,5 +1,3 @@
-// Copyright 2006-2013 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
@@ -151,15 +149,14 @@ public class RequestImpl implements Request
 return;
 }
 
-// check if request specifies an encoding
-String requestEncoding =
-request.getCharacterEncoding() == null
-? applicationCharset
-: request.getCharacterEncoding();
-
+// The request may specify an encoding, which is better than the 
application, which can only
+// guess at what the client is doing!
+
+String requestEncoding = request.getCharacterEncoding();
+
 try
 {
-request.setCharacterEncoding(requestEncoding);
+request.setCharacterEncoding(requestEncoding != null ? 
requestEncoding : applicationCharset);
 } catch (UnsupportedEncodingException ex)
 {
 throw new RuntimeException(ex);

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/a29d1ea9/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestImplTest.java
--
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestImplTest.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestImplTest.java
index 6613d7d..bc9b925 100644
--- 
a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestImplTest.java
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestImplTest.java
@@ -64,6 +64,23 @@ public class RequestImplTest extends InternalBaseTestCase
 }
 
 @Test
+public void used_encoding_from_request() throws Exception {
+HttpServletRequest sr = mockHttpServletRequest();
+
+expect(sr.getCharacterEncoding()).andReturn("request-encoding");
+
+sr.setCharacterEncoding("request-encoding");
+
+
expect(sr.getParameterNames()).andReturn(Collections.enumeration(Collections.EMPTY_LIST));
+
+replay();
+
+new RequestImpl(sr, "app-encoding-is-ignored", 
null).getParameterNames();
+
+verify();
+}
+
+@Test
 public void set_encoding_success() throws Exception
 {
 HttpServletRequest sr = mockHttpServletRequest();
@@ -72,6 +89,8 @@ public class RequestImplTest extends InternalBaseTestCase
 
 sr.setCharacterEncoding(encoding);
 
+expect(sr.getCharacterEncoding()).andReturn(null);
+
 
expect(sr.getParameterNames()).andReturn(Collections.enumeration(Collections.EMPTY_LIST));
 
 replay();
@@ -92,6 +111,8 @@ public class RequestImplTest extends InternalBaseTestCase
 sr.setCharacterEncoding(encoding);
 setThrowable(exception);
 
+expect(sr.getCharacterEncoding()).andReturn(null);
+
 replay();
 
 try



[jira] [Commented] (TAP5-1973) :443 added to URLs when using the Link.toAbsoluteURI(true)

2014-08-01 Thread Lenny Primak (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14083187#comment-14083187
 ] 

Lenny Primak commented on TAP5-1973:


As far as I know the bug still exists, as commented by Alejandro.
He also has a good test for this
That's why I reopened it.

This is exposed when running behind apache / mod_jk combination

> :443 added to URLs when using the Link.toAbsoluteURI(true)
> --
>
> Key: TAP5-1973
> URL: https://issues.apache.org/jira/browse/TAP5-1973
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.4, 5.4
>Reporter: Howard M. Lewis Ship
>Assignee: Kalle Korhonen
>  Labels: fixed-in-5.4-js-rewrite
> Fix For: 5.3.5, 5.4
>
>
> An error in the code means that when secure is true and the port is set to 
> 443, then ":443" is appended:
> int port = secure ? secureHostPort : hostPort;
> String portSuffix = "";
> if (port <= 0) { 
> port = request.getServerPort();
> int schemeDefaultPort = request.isSecure() ? 443 : 80;
> portSuffix = port == schemeDefaultPort ? "" : ":" + port;
> }
> else if (secure && port != 443) portSuffix = ":" + port;
> else if (port != 80) portSuffix = ":" + port;
> 
> String hostname = "".equals(this.hostname) ? request.getServerName() 
> : this.hostname.startsWith("$") ? System.getenv(this.hostname.substring(1)) : 
> this.hostname;
> 
> return String.format("%s://%s%s", secure ? "https" : "http", 
> hostname, portSuffix);
> secure == true && port != 443 is false, so
> port != 80 is evaluated, it true, so
> ":443" is appended.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-1900) Tapestry always uses application charset for request encoding, should first check content-type header

2014-08-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-1900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14083188#comment-14083188
 ] 

ASF subversion and git services commented on TAP5-1900:
---

Commit a29d1ea936802ec2f7a0494afbc2ac63fc0ae8c7 in tapestry-5's branch 
refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=a29d1ea ]

TAP5-1900: Provide better control over Response character set, using value 
specified in Request if possible


> Tapestry always uses application charset for request encoding, should first 
> check content-type header
> -
>
> Key: TAP5-1900
> URL: https://issues.apache.org/jira/browse/TAP5-1900
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.2, 5.3.3, 5.3.4, 5.3.5, 5.3.6
>Reporter: Nelson Rodrigues
>Assignee: Howard M. Lewis Ship
> Attachments: tap5-1900.patch
>
>
> I'm using Tapestry as a sort of REST server, using pages to act as REST 
> gateways to business services.
> To access those pages I'm using Spring's RestTemplate which as a default uses 
> ISO-8859-1 as the request encoding and properly seting the request's 
> content-type header.
> Tapestry currently forces the request encoding to be the same as the 
> application charset (see 
> org.apache.tapestry5.internal.services.RequestImpl.setupEncoding), I believe 
> it should first check the content-type header and use that value instead, 
> only using application charset as a fallback.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-1973) :443 added to URLs when using the Link.toAbsoluteURI(true)

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14083192#comment-14083192
 ] 

Howard M. Lewis Ship commented on TAP5-1973:


Ok, I missed his comment. I look into this.

> :443 added to URLs when using the Link.toAbsoluteURI(true)
> --
>
> Key: TAP5-1973
> URL: https://issues.apache.org/jira/browse/TAP5-1973
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.4, 5.4
>Reporter: Howard M. Lewis Ship
>Assignee: Kalle Korhonen
>  Labels: fixed-in-5.4-js-rewrite
> Fix For: 5.3.5, 5.4
>
>
> An error in the code means that when secure is true and the port is set to 
> 443, then ":443" is appended:
> int port = secure ? secureHostPort : hostPort;
> String portSuffix = "";
> if (port <= 0) { 
> port = request.getServerPort();
> int schemeDefaultPort = request.isSecure() ? 443 : 80;
> portSuffix = port == schemeDefaultPort ? "" : ":" + port;
> }
> else if (secure && port != 443) portSuffix = ":" + port;
> else if (port != 80) portSuffix = ":" + port;
> 
> String hostname = "".equals(this.hostname) ? request.getServerName() 
> : this.hostname.startsWith("$") ? System.getenv(this.hostname.substring(1)) : 
> this.hostname;
> 
> return String.format("%s://%s%s", secure ? "https" : "http", 
> hostname, portSuffix);
> secure == true && port != 443 is false, so
> port != 80 is evaluated, it true, so
> ":443" is appended.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Reopened] (TAP5-1973) :443 added to URLs when using the Link.toAbsoluteURI(true)

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship reopened TAP5-1973:


  Assignee: Howard M. Lewis Ship  (was: Kalle Korhonen)

> :443 added to URLs when using the Link.toAbsoluteURI(true)
> --
>
> Key: TAP5-1973
> URL: https://issues.apache.org/jira/browse/TAP5-1973
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.4, 5.4
>Reporter: Howard M. Lewis Ship
>Assignee: Howard M. Lewis Ship
>  Labels: fixed-in-5.4-js-rewrite
> Fix For: 5.3.5, 5.4
>
>
> An error in the code means that when secure is true and the port is set to 
> 443, then ":443" is appended:
> int port = secure ? secureHostPort : hostPort;
> String portSuffix = "";
> if (port <= 0) { 
> port = request.getServerPort();
> int schemeDefaultPort = request.isSecure() ? 443 : 80;
> portSuffix = port == schemeDefaultPort ? "" : ":" + port;
> }
> else if (secure && port != 443) portSuffix = ":" + port;
> else if (port != 80) portSuffix = ":" + port;
> 
> String hostname = "".equals(this.hostname) ? request.getServerName() 
> : this.hostname.startsWith("$") ? System.getenv(this.hostname.substring(1)) : 
> this.hostname;
> 
> return String.format("%s://%s%s", secure ? "https" : "http", 
> hostname, portSuffix);
> secure == true && port != 443 is false, so
> port != 80 is evaluated, it true, so
> ":443" is appended.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-1973) :443 added to URLs when using the Link.toAbsoluteURI(true)

2014-08-01 Thread Lenny Primak (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14083199#comment-14083199
 ] 

Lenny Primak commented on TAP5-1973:


Also, take a look at my comment from  21/Oct/12 23:26
When running behind Apache/mod_jk, port is 8009, so that's why
this bug manifests itself with this setup.

> :443 added to URLs when using the Link.toAbsoluteURI(true)
> --
>
> Key: TAP5-1973
> URL: https://issues.apache.org/jira/browse/TAP5-1973
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.4, 5.4
>Reporter: Howard M. Lewis Ship
>Assignee: Howard M. Lewis Ship
>  Labels: fixed-in-5.4-js-rewrite
> Fix For: 5.3.5, 5.4
>
>
> An error in the code means that when secure is true and the port is set to 
> 443, then ":443" is appended:
> int port = secure ? secureHostPort : hostPort;
> String portSuffix = "";
> if (port <= 0) { 
> port = request.getServerPort();
> int schemeDefaultPort = request.isSecure() ? 443 : 80;
> portSuffix = port == schemeDefaultPort ? "" : ":" + port;
> }
> else if (secure && port != 443) portSuffix = ":" + port;
> else if (port != 80) portSuffix = ":" + port;
> 
> String hostname = "".equals(this.hostname) ? request.getServerName() 
> : this.hostname.startsWith("$") ? System.getenv(this.hostname.substring(1)) : 
> this.hostname;
> 
> return String.format("%s://%s%s", secure ? "https" : "http", 
> hostname, portSuffix);
> secure == true && port != 443 is false, so
> port != 80 is evaluated, it true, so
> ":443" is appended.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


git commit: TAP5-1973: In certain development cases when switching from insecure to secure, BaseURLSource will still include :443 in the URL

2014-08-01 Thread hlship
Repository: tapestry-5
Updated Branches:
  refs/heads/master a29d1ea93 -> 30a66c952


TAP5-1973: In certain development cases when switching from insecure to secure, 
BaseURLSource will still include :443 in the URL


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/30a66c95
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/30a66c95
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/30a66c95

Branch: refs/heads/master
Commit: 30a66c9526dee3da55a5204e43a169fe4692df79
Parents: a29d1ea
Author: Howard M. Lewis Ship 
Authored: Fri Aug 1 16:54:06 2014 -0700
Committer: Howard M. Lewis Ship 
Committed: Fri Aug 1 16:54:06 2014 -0700

--
 .../internal/services/BaseURLSourceImpl.java| 12 +--
 .../services/BaseURLSourceImplTest.java | 21 ++--
 2 files changed, 24 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/30a66c95/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BaseURLSourceImpl.java
--
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BaseURLSourceImpl.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BaseURLSourceImpl.java
index b7ea719..11b6bd8 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BaseURLSourceImpl.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BaseURLSourceImpl.java
@@ -1,5 +1,3 @@
-// Copyright 2008, 2010, 2011, 2012 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
@@ -48,23 +46,23 @@ public class BaseURLSourceImpl implements BaseURLSource
 
 private String portExtension(boolean secure)
 {
-int port = secure ? secureHostPort : hostPort;
+int configuredPort = secure ? secureHostPort : hostPort;
 
 // The default for the ports is 0, which means to use 
Request.serverPort. That's mostly
 // for development.
-if (port <= 0)
+if (configuredPort <= 0 && secure == request.isSecure())
 {
-port = request.getServerPort();
+configuredPort = request.getServerPort();
 }
 
 int expectedPort = secure ? 443 : 80;
 
-if (port == expectedPort)
+if (configuredPort == expectedPort || configuredPort <= 0)
 {
 return "";
 }
 
-return ":" + port;
+return ":" + configuredPort;
 }
 
 private String hostname()

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/30a66c95/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BaseURLSourceImplTest.java
--
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BaseURLSourceImplTest.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BaseURLSourceImplTest.java
index 5dc4f89..31edf38 100644
--- 
a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BaseURLSourceImplTest.java
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BaseURLSourceImplTest.java
@@ -1,5 +1,3 @@
-// Copyright 2008, 2010, 2011, 2012 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
@@ -36,6 +34,7 @@ public class BaseURLSourceImplTest extends 
InternalBaseTestCase
 {
 expect(request.getServerName()).andReturn("localhost").once();
 expect(request.getServerPort()).andReturn(80).once();
+expect(request.isSecure()).andReturn(false);
 
 replay();
 
@@ -49,6 +48,7 @@ public class BaseURLSourceImplTest extends 
InternalBaseTestCase
 public void contributed_hostname()
 {
 expect(request.getServerPort()).andReturn(80).once();
+expect(request.isSecure()).andReturn(false);
 
 replay();
 
@@ -63,6 +63,7 @@ public class BaseURLSourceImplTest extends 
InternalBaseTestCase
 public void hostname_from_environment_variable()
 {
 expect(request.getServerPort()).andReturn(80).once();
+expect(request.isSecure()).andReturn(false);
 
 replay();
 
@@ -109,4 +110,20 @@ public class BaseURLSourceImplTest extends 
InternalBaseTestCase
 verify();
 }
 
+@Test
+public void secure_url_without_configured_hostports()
+{
+expect(request.isSecure()).andReturn(false).once();
+
+replay();
+
+BaseURLSource baseURLSource = 

[jira] [Updated] (TAP5-2366) Backport: In certain development cases when switching from insecure to secure, BaseURLSource will still include :443 in the URL

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-2366:
---

Labels:   (was: fixed-in-5.4-js-rewrite)

> Backport: In certain development cases when switching from insecure to 
> secure, BaseURLSource will still include :443 in the URL
> ---
>
> Key: TAP5-2366
> URL: https://issues.apache.org/jira/browse/TAP5-2366
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6
>Reporter: Howard M. Lewis Ship
>Assignee: Howard M. Lewis Ship
>
> An error in the code means that when secure is true and the port is set to 
> 443, then ":443" is appended:
> int port = secure ? secureHostPort : hostPort;
> String portSuffix = "";
> if (port <= 0) { 
> port = request.getServerPort();
> int schemeDefaultPort = request.isSecure() ? 443 : 80;
> portSuffix = port == schemeDefaultPort ? "" : ":" + port;
> }
> else if (secure && port != 443) portSuffix = ":" + port;
> else if (port != 80) portSuffix = ":" + port;
> 
> String hostname = "".equals(this.hostname) ? request.getServerName() 
> : this.hostname.startsWith("$") ? System.getenv(this.hostname.substring(1)) : 
> this.hostname;
> 
> return String.format("%s://%s%s", secure ? "https" : "http", 
> hostname, portSuffix);
> secure == true && port != 443 is false, so
> port != 80 is evaluated, it true, so
> ":443" is appended.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (TAP5-2366) Backport: In certain development cases when switching from insecure to secure, BaseURLSource will still include :443 in the URL

2014-08-01 Thread Howard M. Lewis Ship (JIRA)
Howard M. Lewis Ship created TAP5-2366:
--

 Summary: Backport: In certain development cases when switching 
from insecure to secure, BaseURLSource will still include :443 in the URL
 Key: TAP5-2366
 URL: https://issues.apache.org/jira/browse/TAP5-2366
 Project: Tapestry 5
  Issue Type: Bug
  Components: tapestry-core
Affects Versions: 5.3.4, 5.4
Reporter: Howard M. Lewis Ship
Assignee: Howard M. Lewis Ship
 Fix For: 5.4


An error in the code means that when secure is true and the port is set to 443, 
then ":443" is appended:


int port = secure ? secureHostPort : hostPort;
String portSuffix = "";

if (port <= 0) { 
port = request.getServerPort();
int schemeDefaultPort = request.isSecure() ? 443 : 80;
portSuffix = port == schemeDefaultPort ? "" : ":" + port;
}
else if (secure && port != 443) portSuffix = ":" + port;
else if (port != 80) portSuffix = ":" + port;

String hostname = "".equals(this.hostname) ? request.getServerName() : 
this.hostname.startsWith("$") ? System.getenv(this.hostname.substring(1)) : 
this.hostname;

return String.format("%s://%s%s", secure ? "https" : "http", hostname, 
portSuffix);


secure == true && port != 443 is false, so
port != 80 is evaluated, it true, so
":443" is appended.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (TAP5-1973) In certain development cases when switching from insecure to secure, BaseURLSource will still include :443 in the URL

2014-08-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14083213#comment-14083213
 ] 

ASF subversion and git services commented on TAP5-1973:
---

Commit 30a66c9526dee3da55a5204e43a169fe4692df79 in tapestry-5's branch 
refs/heads/master from [~hlship]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=30a66c9 ]

TAP5-1973: In certain development cases when switching from insecure to secure, 
BaseURLSource will still include :443 in the URL


> In certain development cases when switching from insecure to secure, 
> BaseURLSource will still include :443 in the URL
> -
>
> Key: TAP5-1973
> URL: https://issues.apache.org/jira/browse/TAP5-1973
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.4, 5.4
>Reporter: Howard M. Lewis Ship
>Assignee: Howard M. Lewis Ship
>  Labels: fixed-in-5.4-js-rewrite
> Fix For: 5.4
>
>
> An error in the code means that when secure is true and the port is set to 
> 443, then ":443" is appended:
> int port = secure ? secureHostPort : hostPort;
> String portSuffix = "";
> if (port <= 0) { 
> port = request.getServerPort();
> int schemeDefaultPort = request.isSecure() ? 443 : 80;
> portSuffix = port == schemeDefaultPort ? "" : ":" + port;
> }
> else if (secure && port != 443) portSuffix = ":" + port;
> else if (port != 80) portSuffix = ":" + port;
> 
> String hostname = "".equals(this.hostname) ? request.getServerName() 
> : this.hostname.startsWith("$") ? System.getenv(this.hostname.substring(1)) : 
> this.hostname;
> 
> return String.format("%s://%s%s", secure ? "https" : "http", 
> hostname, portSuffix);
> secure == true && port != 443 is false, so
> port != 80 is evaluated, it true, so
> ":443" is appended.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Closed] (TAP5-1973) In certain development cases when switching from insecure to secure, BaseURLSource will still include :443 in the URL

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship closed TAP5-1973.
--

   Resolution: Fixed
Fix Version/s: (was: 5.3.5)

> In certain development cases when switching from insecure to secure, 
> BaseURLSource will still include :443 in the URL
> -
>
> Key: TAP5-1973
> URL: https://issues.apache.org/jira/browse/TAP5-1973
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.4, 5.4
>Reporter: Howard M. Lewis Ship
>Assignee: Howard M. Lewis Ship
>  Labels: fixed-in-5.4-js-rewrite
> Fix For: 5.4
>
>
> An error in the code means that when secure is true and the port is set to 
> 443, then ":443" is appended:
> int port = secure ? secureHostPort : hostPort;
> String portSuffix = "";
> if (port <= 0) { 
> port = request.getServerPort();
> int schemeDefaultPort = request.isSecure() ? 443 : 80;
> portSuffix = port == schemeDefaultPort ? "" : ":" + port;
> }
> else if (secure && port != 443) portSuffix = ":" + port;
> else if (port != 80) portSuffix = ":" + port;
> 
> String hostname = "".equals(this.hostname) ? request.getServerName() 
> : this.hostname.startsWith("$") ? System.getenv(this.hostname.substring(1)) : 
> this.hostname;
> 
> return String.format("%s://%s%s", secure ? "https" : "http", 
> hostname, portSuffix);
> secure == true && port != 443 is false, so
> port != 80 is evaluated, it true, so
> ":443" is appended.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-2366) Backport: In certain development cases when switching from insecure to secure, BaseURLSource will still include :443 in the URL

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-2366:
---

Fix Version/s: (was: 5.4)

> Backport: In certain development cases when switching from insecure to 
> secure, BaseURLSource will still include :443 in the URL
> ---
>
> Key: TAP5-2366
> URL: https://issues.apache.org/jira/browse/TAP5-2366
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6
>Reporter: Howard M. Lewis Ship
>Assignee: Howard M. Lewis Ship
>
> An error in the code means that when secure is true and the port is set to 
> 443, then ":443" is appended:
> int port = secure ? secureHostPort : hostPort;
> String portSuffix = "";
> if (port <= 0) { 
> port = request.getServerPort();
> int schemeDefaultPort = request.isSecure() ? 443 : 80;
> portSuffix = port == schemeDefaultPort ? "" : ":" + port;
> }
> else if (secure && port != 443) portSuffix = ":" + port;
> else if (port != 80) portSuffix = ":" + port;
> 
> String hostname = "".equals(this.hostname) ? request.getServerName() 
> : this.hostname.startsWith("$") ? System.getenv(this.hostname.substring(1)) : 
> this.hostname;
> 
> return String.format("%s://%s%s", secure ? "https" : "http", 
> hostname, portSuffix);
> secure == true && port != 443 is false, so
> port != 80 is evaluated, it true, so
> ":443" is appended.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (TAP5-2366) Backport: In certain development cases when switching from insecure to secure, BaseURLSource will still include :443 in the URL

2014-08-01 Thread Howard M. Lewis Ship (JIRA)

 [ 
https://issues.apache.org/jira/browse/TAP5-2366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Howard M. Lewis Ship updated TAP5-2366:
---

Affects Version/s: (was: 5.3.4)
   (was: 5.4)
   5.3.6

> Backport: In certain development cases when switching from insecure to 
> secure, BaseURLSource will still include :443 in the URL
> ---
>
> Key: TAP5-2366
> URL: https://issues.apache.org/jira/browse/TAP5-2366
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-core
>Affects Versions: 5.3.6
>Reporter: Howard M. Lewis Ship
>Assignee: Howard M. Lewis Ship
>
> An error in the code means that when secure is true and the port is set to 
> 443, then ":443" is appended:
> int port = secure ? secureHostPort : hostPort;
> String portSuffix = "";
> if (port <= 0) { 
> port = request.getServerPort();
> int schemeDefaultPort = request.isSecure() ? 443 : 80;
> portSuffix = port == schemeDefaultPort ? "" : ":" + port;
> }
> else if (secure && port != 443) portSuffix = ":" + port;
> else if (port != 80) portSuffix = ":" + port;
> 
> String hostname = "".equals(this.hostname) ? request.getServerName() 
> : this.hostname.startsWith("$") ? System.getenv(this.hostname.substring(1)) : 
> this.hostname;
> 
> return String.format("%s://%s%s", secure ? "https" : "http", 
> hostname, portSuffix);
> secure == true && port != 443 is false, so
> port != 80 is evaluated, it true, so
> ":443" is appended.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


  1   2   >