Oscar Scholten pushed to branch release/2.2 at cms-community / hippo-testsuite
Commits: a0f6ccf9 by Oscar Scholten at 2017-09-21T11:32:54+02:00 HSTTWO-4136 Add test mechanism for URI encoding (cherry picked from commit 0524e697799dd40bd8eeac80f96f8cdb56c0d436) - - - - - dbe4b33c by Oscar Scholten at 2017-09-21T12:19:03+02:00 HSTTWO-1003 Bump release version - - - - - 4 changed files: - components/src/main/java/org/hippoecm/hst/demo/components/Home.java - content/src/main/resources/hstconfiguration/demosite/templates.xml - pom.xml - + site/src/main/webapp/WEB-INF/hst-config.properties Changes: ===================================== components/src/main/java/org/hippoecm/hst/demo/components/Home.java ===================================== --- a/components/src/main/java/org/hippoecm/hst/demo/components/Home.java +++ b/components/src/main/java/org/hippoecm/hst/demo/components/Home.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2013 Hippo B.V. (http://www.onehippo.com) + * Copyright 2008-2017 Hippo B.V. (http://www.onehippo.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,8 @@ */ package org.hippoecm.hst.demo.components; +import java.util.Map; + import org.hippoecm.hst.component.support.bean.BaseHstComponent; import org.hippoecm.hst.configuration.hosting.Mount; import org.hippoecm.hst.content.beans.ObjectBeanManagerException; @@ -25,6 +27,7 @@ import org.hippoecm.hst.core.component.HstResponse; import org.hippoecm.hst.core.request.HstRequestContext; import org.hippoecm.hst.demo.channel.DemoChannelInfo; import org.hippoecm.hst.site.HstServices; +import org.hippoecm.hst.util.HstRequestUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -62,9 +65,11 @@ public class Home extends BaseHstComponent { request.setAttribute("document", n); - // test parametere from mount property + // test parameter from mount property request.setAttribute("testParamFromMount", getComponentParameter("testParamFromMount")); - } - -} \ No newline at end of file + // parameter to test query string parsing + final Map<String, String[]> parameters = HstRequestUtils.parseQueryString(request.getRequestContext().getServletRequest()); + request.setAttribute("paramsMap", parameters); + } +} ===================================== content/src/main/resources/hstconfiguration/demosite/templates.xml ===================================== --- a/content/src/main/resources/hstconfiguration/demosite/templates.xml +++ b/content/src/main/resources/hstconfiguration/demosite/templates.xml @@ -109,7 +109,7 @@ RESOURCE URL: <@hst.resourceURL><@hst.param name="a" value="one"/><@hst.param name="b" value="two"/></@hst.resourceURL>
 COMPONENT RENDERING URL: <@hst.componentRenderingURL><@hst.param name="a" value="one"/><@hst.param name="b" value="two"/></@hst.componentRenderingURL>
 ACTION URL: <@hst.actionURL><@hst.param name="a" value="one"/><@hst.param name="b" value="two"/></@hst.actionURL>
 -LINK URL: <@hst.link path="/news"><@hst.param name="a" value="one"/><@hst.param name="b" value="two"/></@hst.link></xmp></pre>
 +LINK URL: <@hst.link path="/news"><@hst.param name="a" value="one"/><@hst.param name="key-人" value="value-人"/><@hst.param name="b" value="two"/></@hst.link></xmp></pre>
 
 <hr/>
 <p>Test Example HST URLs (not escaped by escapeXml="false")</p>
 @@ -117,7 +117,13 @@ LINK URL: <@hst.link path="/news"><@hst.param name="a" value="one"/> RESOURCE URL: <@hst.resourceURL escapeXml=false><@hst.param name="a" value="one"/><@hst.param name="b" value="two"/></@hst.resourceURL>
 COMPONENT RENDERING URL: <@hst.componentRenderingURL escapeXml=false><@hst.param name="a" value="one"/><@hst.param name="b" value="two"/></@hst.componentRenderingURL>
 ACTION URL: <@hst.actionURL escapeXml=false><@hst.param name="a" value="one"/><@hst.param name="b" value="two"/></@hst.actionURL>
 -LINK URL: <@hst.link path="/news" escapeXml=false><@hst.param name="a" value="one"/><@hst.param name="b" value="two"/></@hst.link></xmp></pre>
 +LINK URL: <@hst.link path="/news" escapeXml=false><@hst.param name="a" value="one"/><@hst.param name="key-人" value="value-人"/><@hst.param name="b" value="two"/></@hst.link></xmp></pre>
 +
 + <hr/>
 + <p>Parameters (key=[comma separated array of values]):</p>
 + <#list paramsMap?keys as key>
 + <p>${key}=[${paramsMap[key]!?join(",")}]</p>
 + </#list>
 
 <br/><br/>
 
 ===================================== pom.xml ===================================== --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ <parent> <groupId>org.onehippo.cms7</groupId> <artifactId>hippo-cms7-release</artifactId> - <version>10.2.6</version> + <version>10.2.8-SNAPSHOT</version> </parent> ===================================== site/src/main/webapp/WEB-INF/hst-config.properties ===================================== --- /dev/null +++ b/site/src/main/webapp/WEB-INF/hst-config.properties @@ -0,0 +1,7 @@ +# this file is used to be able to override defaults from +# org/hippoecm/hst/site/container/SpringComponentManager.properties + +# comment these out to use the same settings as v12 +# uriencoding.use.container = false +# uriencoding.use.body.charset = false +# uriencoding.default.charset = UTF-8 View it on GitLab: https://code.onehippo.org/cms-community/hippo-testsuite/compare/27c7cefb4948653febf862c467047d09eb83c36d...dbe4b33cc4b13aaad05368463bfb5c808c87ad41 --- View it on GitLab: https://code.onehippo.org/cms-community/hippo-testsuite/compare/27c7cefb4948653febf862c467047d09eb83c36d...dbe4b33cc4b13aaad05368463bfb5c808c87ad41 You're receiving this email because of your account on code.onehippo.org.
_______________________________________________ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn