<%String path = application.getRealPath("/");%>
<%@page import="index.css" %>
I am using String path as above to get the real path of my directory. I want to import index.css from the css folder.
Is it possible in JSP to do something like <%@page import = path+"css/index.css"%>
or is there an easier way to do this?
I think you want to include index.css file to jsp. try this
<jsp:include page="index.css"/>
or
<%@include file="/WEB-INF/include/header.jsp"%>
but i recommend to use tag in html
Neither PHP nor JSP have anything to do with CSS.
You can link the resulting HTML to a stylesheet the same way you would in any other HTML, using the <link>
tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With