[jira] [Created] (WICKET-5263) FilenameWithVersionResourceCachingStrategy breaks silently when the versionPrefix is contained in the original filename
Martin Grigorov created WICKET-5263: --- Summary: FilenameWithVersionResourceCachingStrategy breaks silently when the versionPrefix is contained in the original filename Key: WICKET-5263 URL: https://issues.apache.org/jira/browse/WICKET-5263 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 6.9.0 Reporter: Martin Grigorov Assignee: Martin Grigorov If a resource name contains the character used as version prefix then FilenameWithVersionResourceCachingStrategy#undecorateUrl() will split the decorated filename wrongly and the resource response will return 404 (Not found). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
git commit: WICKET-5263 FilenameWithVersionResourceCachingStrategy breaks silently when the versionPrefix is contained in the original filename
Updated Branches: refs/heads/master ff1cbdee1 - 6c79db3ec WICKET-5263 FilenameWithVersionResourceCachingStrategy breaks silently when the versionPrefix is contained in the original filename Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/6c79db3e Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/6c79db3e Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/6c79db3e Branch: refs/heads/master Commit: 6c79db3ec88201d485aa62457089a1f1dfe72db3 Parents: ff1cbde Author: Martin Tzvetanov Grigorov mgrigo...@apache.org Authored: Wed Jul 3 10:13:44 2013 +0300 Committer: Martin Tzvetanov Grigorov mgrigo...@apache.org Committed: Wed Jul 3 10:13:44 2013 +0300 -- .../FilenameWithVersionResourceCachingStrategy.java | 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/6c79db3e/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/FilenameWithVersionResourceCachingStrategy.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/FilenameWithVersionResourceCachingStrategy.java b/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/FilenameWithVersionResourceCachingStrategy.java index 9581bbf..d470986 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/FilenameWithVersionResourceCachingStrategy.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/FilenameWithVersionResourceCachingStrategy.java @@ -20,6 +20,8 @@ import org.apache.wicket.request.http.WebResponse; import org.apache.wicket.request.resource.AbstractResource; import org.apache.wicket.request.resource.caching.version.IResourceVersion; import org.apache.wicket.util.lang.Args; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * resource caching strategy that adds a version for the @@ -43,6 +45,8 @@ import org.apache.wicket.util.lang.Args; */ public class FilenameWithVersionResourceCachingStrategy implements IResourceCachingStrategy { + private static final Logger LOG = LoggerFactory.getLogger(FilenameWithVersionResourceCachingStrategy.class); + private static final String DEFAULT_VERSION_PREFIX = -ver-; /** string that marks the beginning the of the version in the decorated filename */ @@ -105,6 +109,12 @@ public class FilenameWithVersionResourceCachingStrategy implements IResourceCach // get undecorated filename final String filename = url.getFileName(); + if (filename.contains(getVersionPrefix())) + { + LOG.error(A resource with name '{}' contains the version prefix '{}' so the un-decoration will not work. + +Either use a different version prefix or rename this resource., filename, getVersionPrefix()); + } + // check if resource name has extension final int extensionAt = filename.lastIndexOf('.');
[jira] [Resolved] (WICKET-5263) FilenameWithVersionResourceCachingStrategy breaks silently when the versionPrefix is contained in the original filename
[ https://issues.apache.org/jira/browse/WICKET-5263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Grigorov resolved WICKET-5263. - Resolution: Fixed Fix Version/s: 7.0.0 6.9.0 FilenameWithVersionResourceCachingStrategy breaks silently when the versionPrefix is contained in the original filename --- Key: WICKET-5263 URL: https://issues.apache.org/jira/browse/WICKET-5263 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 6.9.0 Reporter: Martin Grigorov Assignee: Martin Grigorov Fix For: 6.9.0, 7.0.0 If a resource name contains the character used as version prefix then FilenameWithVersionResourceCachingStrategy#undecorateUrl() will split the decorated filename wrongly and the resource response will return 404 (Not found). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
git commit: WICKET-5263 FilenameWithVersionResourceCachingStrategy breaks silently when the versionPrefix is contained in the original filename
Updated Branches: refs/heads/wicket-6.x 73a7dff79 - 0a4c0a900 WICKET-5263 FilenameWithVersionResourceCachingStrategy breaks silently when the versionPrefix is contained in the original filename Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/0a4c0a90 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/0a4c0a90 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/0a4c0a90 Branch: refs/heads/wicket-6.x Commit: 0a4c0a900f77e22cf03ef8b75f5ce87429cfdfcb Parents: 73a7dff Author: Martin Tzvetanov Grigorov mgrigo...@apache.org Authored: Wed Jul 3 10:13:44 2013 +0300 Committer: Martin Tzvetanov Grigorov mgrigo...@apache.org Committed: Wed Jul 3 10:14:17 2013 +0300 -- .../FilenameWithVersionResourceCachingStrategy.java | 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/0a4c0a90/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/FilenameWithVersionResourceCachingStrategy.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/FilenameWithVersionResourceCachingStrategy.java b/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/FilenameWithVersionResourceCachingStrategy.java index 8c7b565..4da94a1 100644 --- a/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/FilenameWithVersionResourceCachingStrategy.java +++ b/wicket-core/src/main/java/org/apache/wicket/request/resource/caching/FilenameWithVersionResourceCachingStrategy.java @@ -20,6 +20,8 @@ import org.apache.wicket.request.http.WebResponse; import org.apache.wicket.request.resource.AbstractResource; import org.apache.wicket.request.resource.caching.version.IResourceVersion; import org.apache.wicket.util.lang.Args; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * resource caching strategy that adds a version for the @@ -43,6 +45,8 @@ import org.apache.wicket.util.lang.Args; */ public class FilenameWithVersionResourceCachingStrategy implements IResourceCachingStrategy { + private static final Logger LOG = LoggerFactory.getLogger(FilenameWithVersionResourceCachingStrategy.class); + private static final String DEFAULT_VERSION_PREFIX = -ver-; /** string that marks the beginning the of the version in the decorated filename */ @@ -105,6 +109,12 @@ public class FilenameWithVersionResourceCachingStrategy implements IResourceCach // get undecorated filename final String filename = url.getFileName(); + if (filename.contains(getVersionPrefix())) + { + LOG.error(A resource with name '{}' contains the version prefix '{}' so the un-decoration will not work. + +Either use a different version prefix or rename this resource., filename, getVersionPrefix()); + } + // check if resource name has extension final int extensionAt = filename.lastIndexOf('.');
[jira] [Updated] (WICKET-5263) FilenameWithVersionResourceCachingStrategy breaks silently when the versionPrefix is contained in the original filename
[ https://issues.apache.org/jira/browse/WICKET-5263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Grigorov updated WICKET-5263: Fix Version/s: (was: 6.9.0) 6.10.0 FilenameWithVersionResourceCachingStrategy breaks silently when the versionPrefix is contained in the original filename --- Key: WICKET-5263 URL: https://issues.apache.org/jira/browse/WICKET-5263 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 6.9.0 Reporter: Martin Grigorov Assignee: Martin Grigorov Fix For: 7.0.0, 6.10.0 If a resource name contains the character used as version prefix then FilenameWithVersionResourceCachingStrategy#undecorateUrl() will split the decorated filename wrongly and the resource response will return 404 (Not found). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (WICKET-5264) CDI Injection no longer working on anonymous classes
Emond Papegaaij created WICKET-5264: --- Summary: CDI Injection no longer working on anonymous classes Key: WICKET-5264 URL: https://issues.apache.org/jira/browse/WICKET-5264 Project: Wicket Issue Type: Bug Components: wicket-cdi Affects Versions: 6.9.0 Reporter: Emond Papegaaij Priority: Blocker The changes made for WICKET-5226 (no longer injecting anonymous inner classes) breaks our applications badly, and I suspect we are not the only one. The following pattern is quite common: add(new LinkVoid(rest) { @Inject private AccountRestResourceClient accountClient; @Override public void onClick() {} } In Wicket 6.9.0, this no longer works: accountClient will not get injected because the Link is an anonymous inner class. To make things worse, even in concrete classes, you can't rely on injection to work, because someone could subclass your class as an anonymous inner class and injection will again not work. This change was made because Weld 2.0 throws an exception when trying to create an InjectionTarget for anonymous classes. This will be reduced to a log-warning in 2.0.2: https://issues.jboss.org/browse/WELD-1441 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
git commit: use PATH_SEPARATOR in exception message
Updated Branches: refs/heads/master 6c79db3ec - 10bceab09 use PATH_SEPARATOR in exception message Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/10bceab0 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/10bceab0 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/10bceab0 Branch: refs/heads/master Commit: 10bceab0920ff6bb4c87ad7a0dc651ce9bcdb86b Parents: 6c79db3 Author: svenmeier s...@meiers.net Authored: Wed Jul 3 15:43:40 2013 +0200 Committer: svenmeier s...@meiers.net Committed: Wed Jul 3 15:43:40 2013 +0200 -- wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/10bceab0/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java index e4b9b5b..3ce58b8 100644 --- a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java +++ b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java @@ -1425,7 +1425,7 @@ public abstract class MarkupContainer extends Component implements IterableComp msg.append(this.toString()); msg.append(\n\tExpected: '); msg.append(getPageRelativePath()); - msg.append(.); + msg.append(PATH_SEPARATOR); msg.append(id); msg.append('.\n\tFound with similar names: '); msg.append(Strings.join(', , names));
git commit: corrected package declaration
Updated Branches: refs/heads/master 10bceab09 - 2acaf1ba1 corrected package declaration Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/2acaf1ba Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/2acaf1ba Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/2acaf1ba Branch: refs/heads/master Commit: 2acaf1ba130f7142b7c661968a929795c9f5d2f1 Parents: 10bceab Author: svenmeier s...@meiers.net Authored: Wed Jul 3 15:47:45 2013 +0200 Committer: svenmeier s...@meiers.net Committed: Wed Jul 3 15:47:45 2013 +0200 -- .../java/org/apache/wicket/cdi/weld/ApacheLicenceHeaderTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/2acaf1ba/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-weld/src/test/java/org/apache/wicket/cdi/weld/ApacheLicenceHeaderTest.java -- diff --git a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-weld/src/test/java/org/apache/wicket/cdi/weld/ApacheLicenceHeaderTest.java b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-weld/src/test/java/org/apache/wicket/cdi/weld/ApacheLicenceHeaderTest.java index 92efb73..bb5a6de 100644 --- a/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-weld/src/test/java/org/apache/wicket/cdi/weld/ApacheLicenceHeaderTest.java +++ b/wicket-experimental/wicket-cdi-1.1/wicket-cdi-1.1-weld/src/test/java/org/apache/wicket/cdi/weld/ApacheLicenceHeaderTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.wicket.cdi; +package org.apache.wicket.cdi.weld; import java.util.Arrays;
git commit: use PATH_SEPARATOR in exception message
Updated Branches: refs/heads/wicket-6.x 0a4c0a900 - 8cb340aea use PATH_SEPARATOR in exception message Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/8cb340ae Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/8cb340ae Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/8cb340ae Branch: refs/heads/wicket-6.x Commit: 8cb340aea1a4ded54b75cefb900c8b5ea6b66363 Parents: 0a4c0a9 Author: svenmeier s...@meiers.net Authored: Wed Jul 3 15:43:53 2013 +0200 Committer: svenmeier s...@meiers.net Committed: Wed Jul 3 15:43:53 2013 +0200 -- wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/8cb340ae/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java index e4b9b5b..3ce58b8 100644 --- a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java +++ b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java @@ -1425,7 +1425,7 @@ public abstract class MarkupContainer extends Component implements IterableComp msg.append(this.toString()); msg.append(\n\tExpected: '); msg.append(getPageRelativePath()); - msg.append(.); + msg.append(PATH_SEPARATOR); msg.append(id); msg.append('.\n\tFound with similar names: '); msg.append(Strings.join(', , names));