You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Craig McClanahan <cr...@apache.org> on 2004/04/02 08:21:06 UTC

Re: Something after RequestProcessor adding extra / to URL?

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