开发者

How to get the base url in jsp?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜