[英]How to give reference to static resources like css,images,java script in JSP?
How to give reference to Static resources like CSS, images, Java Script
in JSP? 如何在JSP中引用静态资源,例如CSS, images, Java Script
? My Web- Application structure is like this: 我的Web应用程序结构如下:
Web Pages
| ↓
| Pages
| ↳ index.jsp <--uses style1.css
↳ Resources
↳ css
↳ style1.css
Inside index.jsp: 内部index.jsp:
<head>
<link rel="stylesheet" type="text/css" href="../Resources/css/style1.css" />
</head>
But this is not working. 但这是行不通的。
Use: 采用:
<head>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/Resources/css/style1.css" />
</head>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.