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??
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.
Try:
<c:url var="baseUri" value="/" />
Note that this will give you a relative url to the context.
精彩评论