Hi ,
l have a index.jsp page , which intend to do a link to a 1.css :
but l don't know how to write the XXX above ? l tried a lot of combinations (/css/1.css , ../css/1.css , ...etc), but failed .Code:<%@ include file="/WEB-INF/jsp/includeTop.jsp" %> <html> <head> <title>How to link the CSS ?</title> <link rel="stylesheet" href="<c:url value="XXX"/>" type="text/css" /> </head> ....
l have the InternalResourceViewResolver configure as below ,
and a dir structure ,Code:<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property> <property name="requestContextAttribute"><value>rc</value></property> <property name="prefix"><value>/WEB-INF/jsp/</value></property> <property name="suffix"><value>.jsp</value></property> </bean>
l read a lot spring's examples , found no similar example , except the country example from the spring distribution ,Code:webAppRootDir ___ css -- 1.css | |___ WEF-INF ___ classes ___ lib ___ jsp -- index.jsp |-- ... other jsps
l tested with the code above , but no luck , still cannot link to the 1.css.Code:<c:set var="css"><spring:theme code="css"/></c:set> <c:if test="${not empty css}"><link rel="stylesheet" href="<c:url value="${css}"/>" type="text/css" /></c:if>
How to link to a css if my jsp pages are in webAppRootDir/WEB-INF/jsp/.. folder ?
yatgor.


Reply With Quote