Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@jakarta.apache.org Received: (qmail 30453 invoked by uid 500); 12 Mar 2001 03:39:52 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: struts-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 30438 invoked from network); 12 Mar 2001 03:39:50 -0000 Received: from clmboh1-smtp3.columbus.rr.com (65.24.0.112) by h31.sny.collab.net with SMTP; 12 Mar 2001 03:39:50 -0000 Received: from win2000 (dhcp065-024-153-085.columbus.rr.com [65.24.153.85]) by clmboh1-smtp3.columbus.rr.com (8.11.2/8.11.2) with SMTP id f2C3bL507808 for ; Sun, 11 Mar 2001 22:37:22 -0500 (EST) From: "James Cook" To: Subject: RE: The use of '..' in relative path includes in JSPs Date: Sun, 11 Mar 2001 22:36:57 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 In-Reply-To: Importance: Normal X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Very cool. Thanks for that info. I thought I saw an option at one time to force URL encoding in Struts, even if the browser supports cookies. Is this true, and will the page attribute also URL encode? thank you, jim > -----Original Message----- > From: Craig R. McClanahan [mailto:craigmcc@apache.org] > Sent: Sunday, March 11, 2001 10:15 PM > To: struts-user@jakarta.apache.org > Subject: RE: The use of '..' in relative path includes in JSPs > > > > > On Sun, 11 Mar 2001, James Cook wrote: > > > Craig, > > > > Forwards and redirects not withstanding, is it a fair statement > to conclude > > that all links (hrefs, image srcs, etc.) in a web application must be > > rendered in a relative manner? > > > > Unfortunately, we could not make such a rule even if we wanted to. > > > There isn't any talk of making relative to a > > context is there? > > > > No, but it's not because this would not be desireable for servlet apps > :-). > > The problem is that paths in an or tag are interpreted by the > *browser*, not by the server. The path "/images/a.gif" is going to be > interpreted as being relative to the document root of the server, not the > context root of the application. Browsers have no clue what a web > application is. > > Struts tries to help you deal with this unpleasantness by including the > "page" attribute on the and tags, which both > accept a context relative path. They both convert this path to be > relative to the server's document root before sending to the browser, so > you can at least pretend your links are all context-relative. So, you can > safely use: > > > > and it will get converted to (assuming "/myapp" is your context path): > > > > which will work as you expect. > > > jim > > > > Craig >