Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

stylesheets

 
rahul karwal
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
how to do u import stylesheets using struts costom tags? i have tried alot but i hava failed to get my stylesheets to work using struts tags, any help will be apprecitated, an example would really help.
my directory structure is as follow:-
------------------ for stylesheeets-------------------------------------
CSS
|___testStyleSheets
|___ myStyleSheets.css

------------------------- my JSP page--------------------------------

JSP
|___testJSP
|___newTest
|___ myJSPPage.jsp

---------------------------------------------------------------------------

thanks
aziz dhanani.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts custom tags have nothing to do with whether you use CSS stylesheets or not -- or where the browser should look for them.

Now, if you have a JSP file under /jsp/MyPage.jsp, it should refer to a stylesheet under /css/MyStyle.css with
<link rel="stylesheet" type="text/css" href="../css/MyStyle.css">
 
M Murthy
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding to Lasse 's :

once you have defined <link ....
you can customize your struts tags by setting the styleClass attribute to a
css class.

Eg:

If you have defined a class as below in your css file

.SmallBoldText { font: bold 10px Verdana; }

then

<html:submit property="someName" styleClass="SmallBoldText">
Submit
</html:submit>

Hope this helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic