<link href="${pageContext.request.contextPath}/styles/themes/default.css" rel="stylesheet">
nweb.xml i add :
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.css</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.js</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.gif</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.jpg</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.png</url-pattern>
</servlet-mapping>
<mvc:resources mapping="/css/**" location="/css/"/>
href="<c:url value='/css/bootstrap.css'/>"
And this will thus mean: in the css folder, right under the root of the webapp. If the context path of your webapp is /myFirstWebApp, the generated href will thus be
href="/myFirstWebApp/css/bootstrap.css"
And in the page header i reference to css file with the following code :
<title></title>
<link href="${pageContext.request.contextPath}/css/global.css" rel="stylesheet" type="text/css" />
</head>
最終更新:2013年07月04日 08:30