• 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

Weirdness with JSTL and Style Sheets

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a JSTL newbie and I'm having some weirdness between JSTL and Style Sheets. Below is my .jsp code using JSTL and also I have a the code for
my servlet. When I had this as a custom tag, it picked up the Style
"COLORED" now it does not. What am I missing? Please send help.

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First thing I would do is perform a View Source from the browser and see what is being sent. Since CSS is a client-side technology, the most probable cause is badly-formed HTML.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it's certainly poor HTML.
Quote the word "stylesheet" (mind lowercase not capitals!!!).
Properly end your HTML code, you're missing the /html closing tag.
Same with all other unquoted HTML properties.
And remember all properties MUST have a value, so no "<option selected>Hello" in a select box but "<option selected='selected'>Hello</option>".

HTML tags should be lowercase, uppercase html code went out the window years ago as a specification (I know some code generators haven't caught on yet).

Your link tag is never closed, this is poor form. Understandable for someone writing their homepage using an outdated HTML tutorial for professionals it should be a mortal sin.

I'd be very careful about using a parameter name "List" which is a Java classname.
Use "list" instead if you must use something that's not descriptive.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Melanie,
It looks like you forgot to add class="COLORED" to the html produced in the iteration tag. The css class is specified on the plain html row above, but is not specified for the ones created by the c:foreach tag.

Good Luck,
Sean

**Wishing I had a community full of gurus to help me with my homework way back when I was in college
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I only wanted the heading to have the color, not the rest of the rows.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From here it's clearly HTML and CSS markup that is in question. As such, moving on to the HTML/Javascript forum.
 
If you were a tree, what sort of tree would you be? This tiny ad is a poop beast.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic