struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <craig...@apache.org>
Subject Re: Something after RequestProcessor adding extra / to URL?
Date Fri, 02 Apr 2004 06:21:06 GMT
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 <Wendy.Smoak@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


Mime
View raw message