wood burning stoves 2.0*
The moose likes Struts and the fly likes stylesheets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "stylesheets" Watch "stylesheets" New topic
Author

stylesheets

rahul karwal
Ranch Hand

Joined: Oct 26, 2001
Posts: 73
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

Joined: Jan 23, 2002
Posts: 11962
    
    5
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">


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
M Murthy
Ranch Hand

Joined: Nov 20, 2004
Posts: 33
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


Sindhu Murthy<br />SCJP 1.4<br />SCBCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: stylesheets