You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by James Holmes <ja...@jamesholmes.com> on 2007/08/13 21:44:14 UTC

Re: svn commit: r565492 - in /struts/struts2/branches/STRUTS_2_0_X/core/src:

Oops...I forgot to mention the JIRA ticket this resolves. Anyone know how to go
back and add a log entry for a commit?

James


On Mon Aug 13 16:00 , jholmes@apache.org sent:

>Author: jholmes
>Date: Mon Aug 13 13:00:08 2007
>New Revision: 565492
>
>URL: http://svn.apache.org/viewvc\?view=rev&rev=565492
>Log: (empty)
>
>Modified:
>   
struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/util/UrlHelper.java
>   
struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/util/UrlHelperTest.java
>
>Modified:
struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/util/UrlHelper.java
>URL:
http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/util/UrlHelper.java\?view=diff&rev=565492&r1=565491&r2=565492
>==============================================================================
>---
struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/util/UrlHelper.java
(original)
>+++
struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/util/UrlHelper.java
Mon Aug 13 13:00:08 2007
>@@ -67,6 +67,7 @@
>     private static int httpsPort = DEFAULT_HTTPS_PORT;
>     private static String customEncoding;
> 
>+
>     @Inject(StrutsConstants.STRUTS_URL_HTTP_PORT)
>     public static void setHttpPort(String val) {
>         httpPort = Integer.parseInt(val);
>@@ -109,22 +110,30 @@
>             link.append(request.getServerName());
> 
>             if (scheme != null) {
>-                if ((scheme.equals("http") && (httpPort != DEFAULT_HTTP_PORT))
|| (scheme.equals("https") && httpsPort != DEFAULT_HTTPS_PORT))
>-                {
>-                    link.append(":");
>-                    link.append(scheme.equals("http") ? httpPort : httpsPort);
>+                // If switching schemes, use the configured port for the
particular scheme.
>+                if (!scheme.equals(reqScheme)) {
>+                    if ((scheme.equals("http") && (httpPort !=
DEFAULT_HTTP_PORT)) || (scheme.equals("https") && httpsPort != DEFAULT_HTTPS_PORT)) {
>+                        link.append(":");
>+                        link.append(scheme.equals("http") ? httpPort : httpsPort);
>+                    }
>+		// Else use the port from the current request.
>+                } else {
>+                    int reqPort = request.getServerPort();
>+
>+                    if ((scheme.equals("http") && (reqPort !=
DEFAULT_HTTP_PORT)) || (scheme.equals("https") && reqPort != DEFAULT_HTTPS_PORT)) {
>+                        link.append(":");
>+                        link.append(reqPort);
>+                    }
>                 }
>             }
>         }
>-        else if (
>-           (scheme != null) && !scheme.equals(request.getScheme())) {
>+        else if ((scheme != null) && !scheme.equals(request.getScheme())) {
>             changedScheme = true;
>             link.append(scheme);
>             link.append("://");
>             link.append(request.getServerName());
> 
>-            if ((scheme.equals("http") && (httpPort != DEFAULT_HTTP_PORT)) ||
(scheme.equals("https") && httpsPort != DEFAULT_HTTPS_PORT))
>-            {
>+            if ((scheme.equals("http") && (httpPort != DEFAULT_HTTP_PORT)) ||
(scheme.equals("https") && httpsPort != DEFAULT_HTTPS_PORT)) {
>                 link.append(":");
>                 link.append(scheme.equals("http") ? httpPort : httpsPort);
>             }
>
>Modified:
struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/util/UrlHelperTest.java
>URL:
http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/util/UrlHelperTest.java\?view=diff&rev=565492&r1=565491&r2=565492
>==============================================================================
>---
struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/util/UrlHelperTest.java
(original)
>+++
struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/util/UrlHelperTest.java
Mon Aug 13 13:00:08 2007
>@@ -40,8 +40,6 @@
>  */
> public class UrlHelperTest extends StrutsTestCase {
> 
>-
>-
>     public void testForceAddSchemeHostAndPort() throws Exception {
>         String expectedUrl =
"http://localhost/contextPath/path1/path2/myAction.action";
> 
>@@ -49,7 +47,8 @@
>         mockHttpServletRequest.expectAndReturn("getScheme", "http");
>         mockHttpServletRequest.expectAndReturn("getServerName", "localhost");
>         mockHttpServletRequest.expectAndReturn("getContextPath", "/contextPath");
>-
>+	mockHttpServletRequest.expectAndReturn("getServerPort", 80);
>+	
>         Mock mockHttpServletResponse = new Mock(HttpServletResponse.class);
>         mockHttpServletResponse.expectAndReturn("encodeURL", expectedUrl,
expectedUrl);
> 
>@@ -74,14 +73,30 @@
>         assertEquals(expectedUrl, result);
>     }
> 
>+    public void testForceAddSchemeHostAndPortWithNonStandardPort() throws
Exception {
>+        String expectedUrl =
"http://localhost:9090/contextPath/path1/path2/myAction.action";
>+
>+        Mock mockHttpServletRequest = new Mock(HttpServletRequest.class);
>+        mockHttpServletRequest.expectAndReturn("getScheme", "http");
>+        mockHttpServletRequest.expectAndReturn("getServerName", "localhost");
>+        mockHttpServletRequest.expectAndReturn("getContextPath", "/contextPath");
>+        mockHttpServletRequest.expectAndReturn("getServerPort", 9090);
>+
>+        Mock mockHttpServletResponse = new Mock(HttpServletResponse.class);
>+        mockHttpServletResponse.expectAndReturn("encodeURL", expectedUrl,
expectedUrl);
>+
>+        String result = UrlHelper.buildUrl("/path1/path2/myAction.action",
(HttpServletRequest) mockHttpServletRequest.proxy(),
(HttpServletResponse)mockHttpServletResponse.proxy(), null, "http", true, true,
true);
>+        assertEquals(expectedUrl, result);
>+        mockHttpServletRequest.verify();
>+    }
>+    
>     public void testForceAddNullSchemeHostAndPort() throws Exception {
>         String expectedUrl =
"http://localhost/contextPath/path1/path2/myAction.action";
> 
>         Mock mockHttpServletRequest = new Mock(HttpServletRequest.class);
>         mockHttpServletRequest.expectAndReturn("getScheme", "http");
>         mockHttpServletRequest.expectAndReturn("getServerName", "localhost");
>-        mockHttpServletRequest.expectAndReturn("getContextPath",
>-            "/contextPath");
>+        mockHttpServletRequest.expectAndReturn("getContextPath", "/contextPath");
> 
>         Mock mockHttpServletResponse = new Mock(HttpServletResponse.class);
>         mockHttpServletResponse.expectAndReturn("encodeURL", expectedUrl,
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: svn commit: r565492 - in /struts/struts2/branches/STRUTS_2_0_X/core/src:

Posted by Musachy Barroso <mu...@gmail.com>.
or the super-easy way, if you are using eclipse, right-click on the
revision (on the Revision History View) and click "Set Commit
Properties".

musachy

On 8/13/07, Ted Husted <hu...@apache.org> wrote:
> There's also a mention of amending log entries  on the Creating and
> Signing a Distribution page, since it happens there too.
>
>  * http://struts.apache.org/2.x/docs/creating-and-signing-a-distribution.html
>
> On 8/13/07, Rahul Akolkar <ra...@gmail.com> wrote:
> > On 8/13/07, James Holmes <ja...@jamesholmes.com> wrote:
> > > Oops...I forgot to mention the JIRA ticket this resolves. Anyone know how to go
> > > back and add a log entry for a commit?
> > >
> > <snip/>
> >
> > http://svnbook.red-bean.com/en/1.0/re23.html
> >
> > -Rahul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: svn commit: r565492 - in /struts/struts2/branches/STRUTS_2_0_X/core/src:

Posted by Ted Husted <hu...@apache.org>.
There's also a mention of amending log entries  on the Creating and
Signing a Distribution page, since it happens there too.

 * http://struts.apache.org/2.x/docs/creating-and-signing-a-distribution.html

On 8/13/07, Rahul Akolkar <ra...@gmail.com> wrote:
> On 8/13/07, James Holmes <ja...@jamesholmes.com> wrote:
> > Oops...I forgot to mention the JIRA ticket this resolves. Anyone know how to go
> > back and add a log entry for a commit?
> >
> <snip/>
>
> http://svnbook.red-bean.com/en/1.0/re23.html
>
> -Rahul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: svn commit: r565492 - in /struts/struts2/branches/STRUTS_2_0_X/core/src:

Posted by Rahul Akolkar <ra...@gmail.com>.
On 8/13/07, James Holmes <ja...@jamesholmes.com> wrote:
> Oops...I forgot to mention the JIRA ticket this resolves. Anyone know how to go
> back and add a log entry for a commit?
>
<snip/>

http://svnbook.red-bean.com/en/1.0/re23.html

-Rahul


> James
>
>
> On Mon Aug 13 16:00 , jholmes@apache.org sent:
>
> >Author: jholmes
> >Date: Mon Aug 13 13:00:08 2007
> >New Revision: 565492
> >
> >URL: http://svn.apache.org/viewvc\?view=rev&rev=565492
> >Log: (empty)
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org