RE: URLs in web apps
and even correctly closed ;) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Mike Clark Sent: 02 September 2000 17:41 To: Orion-Interest Subject: Re: URLs in web apps Indeed it is. Mike Kevin Duffey wrote: HI, Is that a HTML 4.0 tag? I never saw that one before. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Mike Clark Sent: Friday, September 01, 2000 6:48 AM To: Orion-Interest Subject: Re: URLs in web apps Alternatively, you could use this syntax... html head base href="%= request.getContextPath() %" / /head body a href="file.jsp"click/a /body In general, the servlet engine automatically maps the directory name to the application, but references to URLs from standard HTML tags are not automatically mapped. When the base href tag is used, all relative URLs are resolved relative to this value. If your application is mapped to the directory "myapp", then in the example above the href would reference "/myapp/file.jsp". Mike Kevin Duffey wrote: I think your ok..but I use the request.getContextPath() in a "included" header file on all my JSP pages. I assign it to a contextPath string var and use it in all my href tags a href="%= contextPath %/path/file.jsp"click/a But, I believe the spec allows relative paths to the root of the web app. So, if your root is /, and the dir is i3-web, and you have a linke to /path/page.jsp, it would be from /i3-web/path/page.jsp. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Kurt Hoyt Sent: Thursday, August 31, 2000 7:31 PM To: Orion-Interest Subject: URLs in web apps I've noticed an inconsistency in how URLs are used within the servlet engine in Orion. Perhaps I've never had to deal with this since this is the first servlet engine I've used that supports .war files, server.xml, web.xml files, etc. I have a web app that is deployed like this: server.xml contains this line: application name="i3" path="../i3"/ default-web-site.xml contains this line: web-app application="i3" name="i3-web" root="/i3"/ application.xml contains these lines: /module web web-urii3-web/web-uri context-root//context-root /web /module I expect that absolute URLs used anywhere in my JSPs (and that includes a href="..", %@ include file="..." %, and response.sendRedirect() calls) would look like this /i3/rest of URL. However, I've noticed that for anything other than a href="..." tags, the /i3 is implied and all I need is /rest of URL for absolute paths. I have two questions: 1. What does the context-root element do? The servlet and JSP specs are pretty vague about this. 2. Should I be calling request.getContextPath() and using it to create absolute URLs for a href="..." tags or just try and use relative URLs within the a href="..." tags? Kurt in Atlanta -- // // // Mike Clark // // Clarkware Consulting // Enterprise Java Architecture, Design, Development // // http://www.clarkware.com // [EMAIL PROTECTED] // +1.720.851.2014 // -- // // // Mike Clark // // Clarkware Consulting // Enterprise Java Architecture, Design, Development // // http://www.clarkware.com // [EMAIL PROTECTED] // +1.720.851.2014 //
RE: URLs in web apps
While it is a part of the HTML 4.0 spec, it was actually introduced in the HTML 2.0 specification, introduced in 1995. http://www.ics.uci.edu/pub/ietf/html/rfc1866.txt See section 5.2.2 for more information. Browser support for it has been around for quite some time as well (I believe since at least version 2.0 of Netscape) Darren. -- Darren Gibbons[EMAIL PROTECTED] OpenRoad Communications ph: 604.681.0516 Internet Application Development fax: 604.681.0916 Vancouver, B.C. http://www.openroad.ca -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Mike Clark Sent: September 2, 2000 8:41 AM To: Orion-Interest Subject: Re: URLs in web apps Indeed it is. Mike Kevin Duffey wrote: HI, Is that a HTML 4.0 tag? I never saw that one before. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Mike Clark Sent: Friday, September 01, 2000 6:48 AM To: Orion-Interest Subject: Re: URLs in web apps Alternatively, you could use this syntax... html head base href="%= request.getContextPath() %" / /head body a href="file.jsp"click/a /body In general, the servlet engine automatically maps the directory name to the application, but references to URLs from standard HTML tags are not automatically mapped. When the base href tag is used, all relative URLs are resolved relative to this value. If your application is mapped to the directory "myapp", then in the example above the href would reference "/myapp/file.jsp". Mike Kevin Duffey wrote: I think your ok..but I use the request.getContextPath() in a "included" header file on all my JSP pages. I assign it to a contextPath string var and use it in all my href tags a href="%= contextPath %/path/file.jsp"click/a But, I believe the spec allows relative paths to the root of the web app. So, if your root is /, and the dir is i3-web, and you have a linke to /path/page.jsp, it would be from /i3-web/path/page.jsp. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Kurt Hoyt Sent: Thursday, August 31, 2000 7:31 PM To: Orion-Interest Subject: URLs in web apps I've noticed an inconsistency in how URLs are used within the servlet engine in Orion. Perhaps I've never had to deal with this since this is the first servlet engine I've used that supports .war files, server.xml, web.xml files, etc. I have a web app that is deployed like this: server.xml contains this line: application name="i3" path="../i3"/ default-web-site.xml contains this line: web-app application="i3" name="i3-web" root="/i3"/ application.xml contains these lines: /module web web-urii3-web/web-uri context-root//context-root /web /module I expect that absolute URLs used anywhere in my JSPs (and that includes a href="..", %@ include file="..." %, and response.sendRedirect() calls) would look like this /i3/rest of URL. However, I've noticed that for anything other than a href="..." tags, the /i3 is implied and all I need is /rest of URL for absolute paths. I have two questions: 1. What does the context-root element do? The servlet and JSP specs are pretty vague about this. 2. Should I be calling request.getContextPath() and using it to create absolute URLs for a href="..." tags or just try and use relative URLs within the a href="..." tags? Kurt in Atlanta -- // // // Mike Clark // // Clarkware Consulting // Enterprise Java Architecture, Design, Development // // http://www.clarkware.com // [EMAIL PROTECTED] // +1.720.851.2014 // -- // // // Mike Clark // // Clarkware Consulting // Enterprise Java Architecture, Design, Development // // http://www.clarkware.com // [EMAIL PROTECTED] // +1.720.851.2014 //
Re: URLs in web apps
Indeed it is. Mike Kevin Duffey wrote: HI, Is that a HTML 4.0 tag? I never saw that one before. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Mike Clark Sent: Friday, September 01, 2000 6:48 AM To: Orion-Interest Subject: Re: URLs in web apps Alternatively, you could use this syntax... html head base href="%= request.getContextPath() %" / /head body a href="file.jsp"click/a /body In general, the servlet engine automatically maps the directory name to the application, but references to URLs from standard HTML tags are not automatically mapped. When the base href tag is used, all relative URLs are resolved relative to this value. If your application is mapped to the directory "myapp", then in the example above the href would reference "/myapp/file.jsp". Mike Kevin Duffey wrote: I think your ok..but I use the request.getContextPath() in a "included" header file on all my JSP pages. I assign it to a contextPath string var and use it in all my href tags a href="%= contextPath %/path/file.jsp"click/a But, I believe the spec allows relative paths to the root of the web app. So, if your root is /, and the dir is i3-web, and you have a linke to /path/page.jsp, it would be from /i3-web/path/page.jsp. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Kurt Hoyt Sent: Thursday, August 31, 2000 7:31 PM To: Orion-Interest Subject: URLs in web apps I've noticed an inconsistency in how URLs are used within the servlet engine in Orion. Perhaps I've never had to deal with this since this is the first servlet engine I've used that supports .war files, server.xml, web.xml files, etc. I have a web app that is deployed like this: server.xml contains this line: application name="i3" path="../i3"/ default-web-site.xml contains this line: web-app application="i3" name="i3-web" root="/i3"/ application.xml contains these lines: /module web web-urii3-web/web-uri context-root//context-root /web /module I expect that absolute URLs used anywhere in my JSPs (and that includes a href="..", %@ include file="..." %, and response.sendRedirect() calls) would look like this /i3/rest of URL. However, I've noticed that for anything other than a href="..." tags, the /i3 is implied and all I need is /rest of URL for absolute paths. I have two questions: 1. What does the context-root element do? The servlet and JSP specs are pretty vague about this. 2. Should I be calling request.getContextPath() and using it to create absolute URLs for a href="..." tags or just try and use relative URLs within the a href="..." tags? Kurt in Atlanta -- // // // Mike Clark // // Clarkware Consulting // Enterprise Java Architecture, Design, Development // // http://www.clarkware.com // [EMAIL PROTECTED] // +1.720.851.2014 // -- // // // Mike Clark // // Clarkware Consulting // Enterprise Java Architecture, Design, Development // // http://www.clarkware.com // [EMAIL PROTECTED] // +1.720.851.2014 //
Re: URLs in web apps
there is a difference between URLs that are resolved by the http server (i.e. those that are embedded in a page via href=) and those that are resolved by the servlet engine (i.e., when used with the servlet APIs or with JSP-tags that are compiled into such API calls). In the first case, "/" is the document-root of the http server (orion: whatever may be configured as default-web-site), in the latter case it is the context root of the current app. -Original Message- From: Kevin Duffey [EMAIL PROTECTED] To: Orion-Interest [EMAIL PROTECTED] Date: Freitag, 1. September 2000 11:55 Subject: RE: URLs in web apps I think your ok..but I use the request.getContextPath() in a "included" header file on all my JSP pages. I assign it to a contextPath string var and use it in all my href tags a href="%= contextPath %/path/file.jsp"click/a But, I believe the spec allows relative paths to the root of the web app. So, if your root is /, and the dir is i3-web, and you have a linke to /path/page.jsp, it would be from /i3-web/path/page.jsp. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Kurt Hoyt Sent: Thursday, August 31, 2000 7:31 PM To: Orion-Interest Subject: URLs in web apps I've noticed an inconsistency in how URLs are used within the servlet engine in Orion. Perhaps I've never had to deal with this since this is the first servlet engine I've used that supports .war files, server.xml, web.xml files, etc. I have a web app that is deployed like this: server.xml contains this line: application name="i3" path="../i3"/ default-web-site.xml contains this line: web-app application="i3" name="i3-web" root="/i3"/ application.xml contains these lines: /module web web-urii3-web/web-uri context-root//context-root /web /module I expect that absolute URLs used anywhere in my JSPs (and that includes a href="..", %@ include file="..." %, and response.sendRedirect() calls) would look like this /i3/rest of URL. However, I've noticed that for anything other than a href="..." tags, the /i3 is implied and all I need is /rest of URL for absolute paths. I have two questions: 1. What does the context-root element do? The servlet and JSP specs are pretty vague about this. 2. Should I be calling request.getContextPath() and using it to create absolute URLs for a href="..." tags or just try and use relative URLs within the a href="..." tags? Kurt in Atlanta
Re: URLs in web apps
Alternatively, you could use this syntax... html head base href="%= request.getContextPath() %" / /head body a href="file.jsp"click/a /body In general, the servlet engine automatically maps the directory name to the application, but references to URLs from standard HTML tags are not automatically mapped. When the base href tag is used, all relative URLs are resolved relative to this value. If your application is mapped to the directory "myapp", then in the example above the href would reference "/myapp/file.jsp". Mike Kevin Duffey wrote: I think your ok..but I use the request.getContextPath() in a "included" header file on all my JSP pages. I assign it to a contextPath string var and use it in all my href tags a href="%= contextPath %/path/file.jsp"click/a But, I believe the spec allows relative paths to the root of the web app. So, if your root is /, and the dir is i3-web, and you have a linke to /path/page.jsp, it would be from /i3-web/path/page.jsp. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Kurt Hoyt Sent: Thursday, August 31, 2000 7:31 PM To: Orion-Interest Subject: URLs in web apps I've noticed an inconsistency in how URLs are used within the servlet engine in Orion. Perhaps I've never had to deal with this since this is the first servlet engine I've used that supports .war files, server.xml, web.xml files, etc. I have a web app that is deployed like this: server.xml contains this line: application name="i3" path="../i3"/ default-web-site.xml contains this line: web-app application="i3" name="i3-web" root="/i3"/ application.xml contains these lines: /module web web-urii3-web/web-uri context-root//context-root /web /module I expect that absolute URLs used anywhere in my JSPs (and that includes a href="..", %@ include file="..." %, and response.sendRedirect() calls) would look like this /i3/rest of URL. However, I've noticed that for anything other than a href="..." tags, the /i3 is implied and all I need is /rest of URL for absolute paths. I have two questions: 1. What does the context-root element do? The servlet and JSP specs are pretty vague about this. 2. Should I be calling request.getContextPath() and using it to create absolute URLs for a href="..." tags or just try and use relative URLs within the a href="..." tags? Kurt in Atlanta -- // // // Mike Clark // // Clarkware Consulting // Enterprise Java Architecture, Design, Development // // http://www.clarkware.com // [EMAIL PROTECTED] // +1.720.851.2014 //
RE: URLs in web apps
HI, Is that a HTML 4.0 tag? I never saw that one before. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Mike Clark Sent: Friday, September 01, 2000 6:48 AM To: Orion-Interest Subject: Re: URLs in web apps Alternatively, you could use this syntax... html head base href="%= request.getContextPath() %" / /head body a href="file.jsp"click/a /body In general, the servlet engine automatically maps the directory name to the application, but references to URLs from standard HTML tags are not automatically mapped. When the base href tag is used, all relative URLs are resolved relative to this value. If your application is mapped to the directory "myapp", then in the example above the href would reference "/myapp/file.jsp". Mike Kevin Duffey wrote: I think your ok..but I use the request.getContextPath() in a "included" header file on all my JSP pages. I assign it to a contextPath string var and use it in all my href tags a href="%= contextPath %/path/file.jsp"click/a But, I believe the spec allows relative paths to the root of the web app. So, if your root is /, and the dir is i3-web, and you have a linke to /path/page.jsp, it would be from /i3-web/path/page.jsp. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Kurt Hoyt Sent: Thursday, August 31, 2000 7:31 PM To: Orion-Interest Subject: URLs in web apps I've noticed an inconsistency in how URLs are used within the servlet engine in Orion. Perhaps I've never had to deal with this since this is the first servlet engine I've used that supports .war files, server.xml, web.xml files, etc. I have a web app that is deployed like this: server.xml contains this line: application name="i3" path="../i3"/ default-web-site.xml contains this line: web-app application="i3" name="i3-web" root="/i3"/ application.xml contains these lines: /module web web-urii3-web/web-uri context-root//context-root /web /module I expect that absolute URLs used anywhere in my JSPs (and that includes a href="..", %@ include file="..." %, and response.sendRedirect() calls) would look like this /i3/rest of URL. However, I've noticed that for anything other than a href="..." tags, the /i3 is implied and all I need is /rest of URL for absolute paths. I have two questions: 1. What does the context-root element do? The servlet and JSP specs are pretty vague about this. 2. Should I be calling request.getContextPath() and using it to create absolute URLs for a href="..." tags or just try and use relative URLs within the a href="..." tags? Kurt in Atlanta -- // // // Mike Clark // // Clarkware Consulting // Enterprise Java Architecture, Design, Development // // http://www.clarkware.com // [EMAIL PROTECTED] // +1.720.851.2014 //
Re: URLs in web apps
I'm pretty sure it's a standard HTML tag. Brien Voorhees Invest.com - Original Message - From: "Kevin Duffey" [EMAIL PROTECTED] To: "Orion-Interest" [EMAIL PROTECTED] Sent: Friday, September 01, 2000 2:23 PM Subject: RE: URLs in web apps HI, Is that a HTML 4.0 tag? I never saw that one before. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Mike Clark Sent: Friday, September 01, 2000 6:48 AM To: Orion-Interest Subject: Re: URLs in web apps Alternatively, you could use this syntax... html head base href="%= request.getContextPath() %" / /head body a href="file.jsp"click/a /body In general, the servlet engine automatically maps the directory name to the application, but references to URLs from standard HTML tags are not automatically mapped. When the base href tag is used, all relative URLs are resolved relative to this value. If your application is mapped to the directory "myapp", then in the example above the href would reference "/myapp/file.jsp". Mike Kevin Duffey wrote: I think your ok..but I use the request.getContextPath() in a "included" header file on all my JSP pages. I assign it to a contextPath string var and use it in all my href tags a href="%= contextPath %/path/file.jsp"click/a But, I believe the spec allows relative paths to the root of the web app. So, if your root is /, and the dir is i3-web, and you have a linke to /path/page.jsp, it would be from /i3-web/path/page.jsp. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Kurt Hoyt Sent: Thursday, August 31, 2000 7:31 PM To: Orion-Interest Subject: URLs in web apps I've noticed an inconsistency in how URLs are used within the servlet engine in Orion. Perhaps I've never had to deal with this since this is the first servlet engine I've used that supports .war files, server.xml, web.xml files, etc. I have a web app that is deployed like this: server.xml contains this line: application name="i3" path="../i3"/ default-web-site.xml contains this line: web-app application="i3" name="i3-web" root="/i3"/ application.xml contains these lines: /module web web-urii3-web/web-uri context-root//context-root /web /module I expect that absolute URLs used anywhere in my JSPs (and that includes a href="..", %@ include file="..." %, and response.sendRedirect() calls) would look like this /i3/rest of URL. However, I've noticed that for anything other than a href="..." tags, the /i3 is implied and all I need is /rest of URL for absolute paths. I have two questions: 1. What does the context-root element do? The servlet and JSP specs are pretty vague about this. 2. Should I be calling request.getContextPath() and using it to create absolute URLs for a href="..." tags or just try and use relative URLs within the a href="..." tags? Kurt in Atlanta -- // // // Mike Clark // // Clarkware Consulting // Enterprise Java Architecture, Design, Development // // http://www.clarkware.com // [EMAIL PROTECTED] // +1.720.851.2014 //
URLs in web apps
I've noticed an inconsistency in how URLs are used within the servlet engine in Orion. Perhaps I've never had to deal with this since this is the first servlet engine I've used that supports .war files, server.xml, web.xml files, etc. I have a web app that is deployed like this: server.xml contains this line: application name="i3" path="../i3"/ default-web-site.xml contains this line: web-app application="i3" name="i3-web" root="/i3"/ application.xml contains these lines: /module web web-urii3-web/web-uri context-root//context-root /web /module I expect that absolute URLs used anywhere in my JSPs (and that includes a href="..", %@ include file="..." %, and response.sendRedirect() calls) would look like this /i3/rest of URL. However, I've noticed that for anything other than a href="..." tags, the /i3 is implied and all I need is /rest of URL for absolute paths. I have two questions: 1. What does the context-root element do? The servlet and JSP specs are pretty vague about this. 2. Should I be calling request.getContextPath() and using it to create absolute URLs for a href="..." tags or just try and use relative URLs within the a href="..." tags? Kurt in Atlanta
RE: URLs in web apps
I think your ok..but I use the request.getContextPath() in a "included" header file on all my JSP pages. I assign it to a contextPath string var and use it in all my href tags a href="%= contextPath %/path/file.jsp"click/a But, I believe the spec allows relative paths to the root of the web app. So, if your root is /, and the dir is i3-web, and you have a linke to /path/page.jsp, it would be from /i3-web/path/page.jsp. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Kurt Hoyt Sent: Thursday, August 31, 2000 7:31 PM To: Orion-Interest Subject: URLs in web apps I've noticed an inconsistency in how URLs are used within the servlet engine in Orion. Perhaps I've never had to deal with this since this is the first servlet engine I've used that supports .war files, server.xml, web.xml files, etc. I have a web app that is deployed like this: server.xml contains this line: application name="i3" path="../i3"/ default-web-site.xml contains this line: web-app application="i3" name="i3-web" root="/i3"/ application.xml contains these lines: /module web web-urii3-web/web-uri context-root//context-root /web /module I expect that absolute URLs used anywhere in my JSPs (and that includes a href="..", %@ include file="..." %, and response.sendRedirect() calls) would look like this /i3/rest of URL. However, I've noticed that for anything other than a href="..." tags, the /i3 is implied and all I need is /rest of URL for absolute paths. I have two questions: 1. What does the context-root element do? The servlet and JSP specs are pretty vague about this. 2. Should I be calling request.getContextPath() and using it to create absolute URLs for a href="..." tags or just try and use relative URLs within the a href="..." tags? Kurt in Atlanta