Reputation: 2633
Im creating a simple project by using jsp and servlet. I want to link the css in my jsp file. So any one can tell me the way to do this??
Upvotes: 0
Views: 1774
Reputation: 597362
Try:
<c:url var="baseUri" value="/" />
Note that this will give you a relative url to the context.
Upvotes: 0
Reputation: 8292
You just need to do:
<link rel="stylesheet" type="text/css" href="css/style.css"/>
provided that you have style.css file in folder "css" near your .jsp file. You don't need to know the base URL for that, this will work with any base URL that leads to your .jsp file.
Upvotes: 3