Forum Moderators: not2easy

Message Too Old, No Replies

CSS is found but not always used

         

Balsi

8:56 am on Jan 12, 2007 (gmt 0)

10+ Year Member



Hi there,

I have the following Problem:

I have a Web- Project based on Struts (v. 1.3) and genereatet out of the struts-blank.war. So far everything is working correctly.

I am using an Apache v.4.1 Webserver simulatet in Websphere v.5.1 Application Developper. So far everything is working with forwarding, session handling and stuff, but now i am realy having a bad problem you maybe know:

I have assumed the correct path to my Css and it's used if i just open the .jsp site storred localy on my main drive (then surely the Struts related things dont work).

But if i load everything on my virtual Web-Server and then check the site over that Server the Css is not been used. Everything beside the format informations out of that css is working even the correct path to the Css is shown in the Source Code.

If you know that Problem or if you need any more information i would realy be thankful for your help because i dont even know where to search anymore:(

Regards
Balsi

netchicken1

9:05 am on Jan 12, 2007 (gmt 0)

10+ Year Member



Just a thought.

Do you have the stylesheet link, and the CSS file with the same cases for the name?

So Mysite.css and Mysite.css, not mysite.css or MYSITE.css

Balsi

9:12 am on Jan 12, 2007 (gmt 0)

10+ Year Member



Thank you for your fast replie.

Yeah, i checked all the basic typical misstakes. And yeah, they have the same names (case sensitive checked) thats why its used if i open the .jsp file on my local hard drive.

I now saw that even the Websphere Framework can read the css informations to generate a preview but as soon as its on that Webserver and i try to call the site all the format informations are not longer used:(

I will now try another web-server but i dont thing reading a css is NOT supportet by any Web-server.

Regards
Balsi

pageoneresults

9:27 am on Jan 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld Balsi!

Try using an absolute path to the file...

http://www.example.com/css/file.css

Balsi

9:42 am on Jan 12, 2007 (gmt 0)

10+ Year Member



Hy and thanks for your fast replies:D

Ok, i tried:

[localhost:8080...]
[localhost:8080...]

but nothing of both was available (never saw that working on struts correctly with direct links)

I also tried:

[localhost:8080...]

to ensure that i have tried the very direct link but nothing better there:(

if i call the site over the correct action so the link looks like:

[localhost:8080...]

and i can right click on the displayed site and in the source code is the right direction to the css:/

I also tried to link the css relative to the jsp site as well as strong from the webservers root directory... nothing worked:(

I now try to use another apache server just to have checked that too... it must be something about the Webserver specially since the css is found and interpretet correctly when calling the site with the browser like this:

C:\wsrBwrWeb\WebContent\pages\jsp\bwr\bwrIndex.jsp

Regards
Balsi

Balsi

11:18 am on Jan 12, 2007 (gmt 0)

10+ Year Member



I gave it up, i will check if its working on a free webhoster which supplies struts (still at work yet... so later:D). If so i at least know that there is nothing bugged in the web- project itself.

Thanks for your help.

Regards
Balsi

Balsi

3:36 pm on Jan 12, 2007 (gmt 0)

10+ Year Member



KK, finaly found it out. In my case there was an additional problem caused by the webSphere configurations.

The most likely Problem (and its realy a problem) will be that WebSphere seems to get "../css/css.css" as: Go one folder up, search a folder called css, enter it and search for a file called css.css -- open it. So far so good, that what i have tryied and Websphere understand me:D

BUT:

It looks as the Websphere Test-server would interpret it as ../ move one folder up from the root path which means there is no further Webgroup (thats how Websphere calls a folder) and thats why the css is not found. So i had to now use a static path from the testservers Root directory which made all the css informations be interpretet how expectet:D

Thanks for your Help.
Regards
Balsi

SuzyUK

9:12 pm on Jan 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld Balsi, and glad you got it figured out.

Thanks for letting us know :)