• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP with CSS does not display the background image

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
i dont understand what am i doing wrong.

I have a jsp file that i am using with a CSS.
My directory structure is like this:

ProjectName
--Web
---IMAGES
----linkhead.jpg
---stylesheets
----homepagestylesheet.css
--home.jsp


in my CSS i have defined the #header id selector as follows:



when i try to open this jsp through Tomcat , it applies the CSS (like the fonts and DIVs however my background images are not showing up) None of the background images are showing up


If i have the same directory structure and i save the jsp file as html(Not through Tomcat) , and open it then the background shows up however openening the same file as html through Tomcat also doesnot show me the background

what am i doing wrong?
I even tried to put the image file directly under the Web folder along with the jsp file and css but still it does the same thing.

-Thanks.
[ November 03, 2007: Message edited by: prakash chauhan ]
 
prakash chauhan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh i was doing a mistake , its working now..
i placed the IMAGES folder within my Stylesheets folder and now images are showing up.
-Thanks.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the similar problem and I don't know how to fix it.

I have the following directory structure



My CSS tries to use an image as a background



and it doesn't work while other parts of css work fine.

Firebug shows that application tries to access image by URL _http://localhost:8080/images/img02.jpg and gets 404 error

When I try to access image directly I also get this error. Also I tried _http://localhost:8080/paygate/images/img02.jpg _http://localhost:8080/paygate/resources/images/img02.jpg ...and this error doesn't stop follow me.

How should I organize my directory structure or what should I do to make my images accessible. Thank's!

P.S. I'm using springsource tc server as a webserver.
 
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please note



and




and i am not able to understand why you have putted your style.css in two different location.

Why not make a folder and put all the CSS in it..

One more thing,,

You directory structore shows there is so many error you have in your project.Try to correct all the error before running it.
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
one more thing try cleaning your complete project and also tomcat server,then run the jsp file
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic