You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Wendy Smoak <We...@asu.edu> on 2004/04/02 00:21:16 UTC

Something after RequestProcessor adding extra / to URL? (was: URL validation)

In another thread, rleland@apache.org wrote:
> The way I read http://www.faqs.org/rfcs/rfc2396.html
> section 3.3
> I don't believe the path segment can legally end with a '/'.
> Read the RFC and see what you think.
> So I don't believe http://www.google.com:80/?action=xyz
> strictly speaking is valid, should we optionally allow for it
> probably.

Something in or after the RequestProcessor is producing URL's with that
same pattern (including /?) in my app.  I asked on the users list and
was told it didn't matter, but if that's really an invalid URL, perhaps
someone could look into it.  Here's the original thread:

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg96484.html

In the Action, I have:
  log.info("redirecting to: "+redirectURL);
  return new ActionForward( redirectURL, true );

The logs say:
15:53:45,640 - INFO edu.asu.vpia.struts.HarrisLoginAction - redirecting
to: http://www.example.com?user=0123456
15:53:45,640 - DEBUG org.apache.struts.action.RequestProcessor -
processForwardConfig(ForwardConfig[name=null,path=http://www.example.com
?user=0123456,redirect=true,contextRelative=false])

So I'm pretty sure there is no / after example.com, but what I see in
the browser is:

http://www.example.com/?user=0123456

Does anyone know where the extra '/' is coming from, or if it matters at
all?

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 



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


Re: Something after RequestProcessor adding extra / to URL?

Posted by Craig McClanahan <cr...@apache.org>.
Hubert Rabago wrote:

>>So I'm pretty sure there is no / after example.com, but what I see in
>>the browser is:
>>
>>http://www.example.com/?user=0123456
>>
>>Does anyone know where the extra '/' is coming from, or if it matters at
>>all?
>>    
>>
>
>Now that I take a second look at it, I think it's possible that the browser
>is the one adding the "/" after the "http://www.example.com".  Have you tried
>this with different browsers and different versions?
>  
>
It is actually the server doing this, not the browser.

Both Apache's HTTPD server, and Tomcat, when you send them a URL like 
"http://www.foo.com" will issue a redirect to "http://www.foo.com/".  In 
both cases, this ends up requesting the welcome file -- but the 
interesting thing is *why* this is done.  It's to ensure that relative 
URLs in the welcome file page are resolved correctly to resources in the 
same directory.

FWIW, I'm sure that "http://www.example.com/?user=0123456" is a 
perfectly valid URL.  It just happens to have a zero-length path element.

Craig

>	
>
>--- Wendy Smoak <We...@asu.edu> wrote:
>  
>
>>http://www.mail-archive.com/struts-user@jakarta.apache.org/msg96484.html
>>
>>In the Action, I have:
>>  log.info("redirecting to: "+redirectURL);
>>  return new ActionForward( redirectURL, true );
>>
>>The logs say:
>>15:53:45,640 - INFO edu.asu.vpia.struts.HarrisLoginAction - redirecting
>>to: http://www.example.com?user=0123456
>>15:53:45,640 - DEBUG org.apache.struts.action.RequestProcessor -
>>processForwardConfig(ForwardConfig[name=null,path=http://www.example.com
>>?user=0123456,redirect=true,contextRelative=false])
>>
>>So I'm pretty sure there is no / after example.com, but what I see in
>>the browser is:
>>
>>http://www.example.com/?user=0123456
>>
>>Does anyone know where the extra '/' is coming from, or if it matters at
>>all?
>>
>>-- 
>>Wendy Smoak
>>Application Systems Analyst, Sr.
>>ASU IA Information Resources Management 
>>    
>>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Small Business $15K Web Design Giveaway 
>http://promotions.yahoo.com/design_giveaway/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>  
>


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


Re: Something after RequestProcessor adding extra / to URL? (was: URL validation)

Posted by Hubert Rabago <ja...@yahoo.com>.
> So I'm pretty sure there is no / after example.com, but what I see in
> the browser is:
> 
> http://www.example.com/?user=0123456
> 
> Does anyone know where the extra '/' is coming from, or if it matters at
> all?

Now that I take a second look at it, I think it's possible that the browser
is the one adding the "/" after the "http://www.example.com".  Have you tried
this with different browsers and different versions?


--- Wendy Smoak <We...@asu.edu> wrote:
> 
> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg96484.html
> 
> In the Action, I have:
>   log.info("redirecting to: "+redirectURL);
>   return new ActionForward( redirectURL, true );
> 
> The logs say:
> 15:53:45,640 - INFO edu.asu.vpia.struts.HarrisLoginAction - redirecting
> to: http://www.example.com?user=0123456
> 15:53:45,640 - DEBUG org.apache.struts.action.RequestProcessor -
> processForwardConfig(ForwardConfig[name=null,path=http://www.example.com
> ?user=0123456,redirect=true,contextRelative=false])
> 
> So I'm pretty sure there is no / after example.com, but what I see in
> the browser is:
> 
> http://www.example.com/?user=0123456
> 
> Does anyone know where the extra '/' is coming from, or if it matters at
> all?
> 
> -- 
> Wendy Smoak
> Application Systems Analyst, Sr.
> ASU IA Information Resources Management 


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

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