-1

I have a JSP page which uses some kind of JSTL statment to refer a CSS...

<jstl:tag ...href=abc.css>

Now this same abc.css is located in 3 separate folders and based on some condition it picks dynamically from one of these 3 folders..

I am not sure howitdoes that and wantec to understand if this logic iswritten somewherewithin the JSTL TLD or in some Java class...what can be the possibilities?

Thank you.

copenndthagen
  • 49,230
  • 102
  • 290
  • 442

1 Answers1

0

You can use the JSTL c:choose tag for this purpose. For eg:

<c:choose>
<c:when test="some condition">
<link rel="stylesheet" href="path to your css" type="text/css">
<!--If this condition is true use this css-->
</c:when>
<c:when test="some other condition">
<link rel="stylesheet" href="path to your css" type="text/css">
<!--If this condition is true use this css-->
</c:when>
<c:otherwise>
<link rel="stylesheet" href="path to your css" type="text/css">
<!--If none of the conditions are true use this css-->
</c:otherwise>
</c:choose>
Divesh
  • 156
  • 2
  • Thx for your answer...While I understand that the conditional thing is how the CSS should get linked dynamically...However in my case there is no such condition and even then, a CSS file gets appended dynamically..seems somehow through the JSTL – copenndthagen Jul 04 '11 at 08:49