Re: mod_proxy: CSS & JavaScript not loaded

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Tue, Apr 28, 2009 at 7:54 AM, John Ruffin <jruffguru@xxxxxxxxx> wrote:
Thanks Andre!  I noticed after I sent the post that I'm getting a 404 in the html where the browser has tried to get the _javascript_.  404 because the application name has been pre-pended to the front of the URL twice.  I'm not clear on how/why this happens.

See snippet below:

<script src="/alge-webapp/a4j/g/3_2_2.SR1org.ajax4jsf._javascript_
.PrototypeScript.jsf
"
 type="text/_javascript_">
1<html><head><title>Apache Tomcat/6.0.18 - Error report</title>}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /alge-webapp/alge-webapp/a4j/g/3_2_2.SR1org.ajax4jsf._javascript_.PrototypeScript.jsf</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/alge-webapp/alge-webapp/a4j/g/3_2_2.SR1org.ajax4jsf._javascript_.PrototypeScript.jsf</u></p><p><b>description</b> <u>The requested resource (/alge-webapp/alge-webapp/a4j/g/3_2_2.SR1org.ajax4jsf._javascript_.PrototypeScript.jsf) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.18</h3></body></html>
</script>

Oh, I enter this URL http://collegeflair.com - this is the URL after the page loads http://collegeflair.com/stanford.jsf.  This URL is setup in /private/etc/hosts.

After I click a link, this is the URL:
http://collegeflair.com/alge-webapp/stanford.jsf;jsessionid=B484F34787DE4412AEE848D7093170C8


On Tue, Apr 28, 2009 at 2:53 AM, André Warnier <aw@xxxxxxxxxx> wrote:
John Ruffin wrote:
...
Hi.
My suggestion : first turn off the proxy html stuff and try to see what exactly is happening, from the browser's point of view.
Do the following, systematically :
- access one of your pages
- note the URL (in the URL bar of the browser) that was used to access that page (and print it here)
- next, in the browser, look at the source of the page as the browser got it.  What do the references to CSS and other embedded links in the page look like ? Print an example here.

Next, if you want to debug the problem yourself (and most similar problems), here is the logic to follow :

The browser works as follows :
- it obtains the current page from requesting a certain URL.  That URL is now, for the browser, the *current URL* where this page now being displayed comes from.  The browser knows nothing else (it doesn't know for example that the page was generated by a back-end).
- in the course of interpreting the current page, the browser sees a link to another item, for example a reference to a stylesheet.  The browser is going to try and get that item.
For that, it must first "interpret" this URL, in function of what kind of URL this is :
a) if it is an absolute URL, then it will just request it, without change (example : "http://yourhost.company.com/stylesheets/stylesheet1.css")
b) if it is an absolute URL, but without the first part (scheme, host) (e.g. "/stylesheets/stylesheet1.css") then the browser will use it to recompose a complete URL, by prefixing it with the same scheme+host from which it obtained the current page.  Thus if the current page came from the scheme+host "http://yourhost.company.com", the browser will put these two elements together and request the object
"http://yourhost.company.com/stylesheets/stylesheet1.css"
(yes, the same as before)
c) if it is a relative URL, like "stylesheets/stylesheet1.css") then the browser has to be a bit more creative.  What it will do is
- take the URI of the current page
(e.g. "http://yourhost.company.com/yourapp/index.jsp?k=par1"
- remove anything not belonging to the URI
(in this case : "?k=par1")
- remove the last element of the URI
(in this case "index.jsp")
- add instead the relative URI of the embedded item
(in this case "stylesheets/stylesheet1.css"), thus giving
"http://yourhost.company.com/yourapp/stylesheets/stylesheet1.css"
and then request that.

You have any of the cases a, b or c.
When you know which case it is, you can simulate it by entering the same final URL of the stylesheet, directly in the browser URL bar, and see what happens.  That will put you on the way to the real issue.




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
 "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux