`

Add css js image in spring mvc

阅读更多
这里我卡了好久,一开始我的代码是:
<mvc:resources mapping="/resources/**" location="/public-resources/"/>

但是无论我怎么折腾都不行,后来查stackoverflow发现了我的问题,正确的是配置:
<mvc:resources mapping="/resources/**" location="/WEB-INF/public-resources/"/>


然后在jsp页面中引入:
<link rel="stylesheet"  type="text/css" href="<%=request.getContextPath()%>/resources/css/main.css"/>

详情见:
引用
http://stackoverflow.com/questions/20537863/add-css-in-spring-mvc
分享到:
评论

相关推荐

    HTML, XHTML, and CSS All-in-one Desk Reference For Dummies

    You′ll learn how to work with Positionable CSS to create floating elements, margins, and multi–column layouts, and you′ll get up to speed on client–side programming with JavaScript. You′ll also ...

    spring_MVC源码

    弃用了struts,用spring mvc框架做了几个项目,感觉都不错,而且使用了注解方式,可以省掉一大堆配置文件。本文主要介绍使用注解方式配置的spring mvc,之前写的spring3.0 mvc和rest小例子没有介绍到数据层的内容,...

    HTML, CSS & JavaScript Web Publishing in One Hour a Day 7th 第7版 0分

    Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day, Covers HTML5, CSS3, and jQuery 7th Series: Sams Teach Yourself Paperback: 768 pages Publisher: Sams Publishing; 7 edition ...

    Spring Dynamic Modules in Action

    With Spring DM, you can easily create highly modular applications and you can dynamically add, remove, and update your modules. Spring Dynamic Modules in Action is a comprehensive tutorial that ...

    tailwindcss-image-rendering:Tailwind CSS的图像渲染实用程序

    Tailwind CSS图像渲染插件 该插件添加了实用程序,可...yarn add -D tailwindcss-image-rendering 用法 // tailwind.config.js { theme : { } , // no options to configure variants : { // all the following defau

    asp.net mvc add edit delete

    asp.net mvc add edit delete asp.net mvc add edit delete asp.net mvc add edit delete

    Packt.Hands-On.Spring.Security.5.for.Reactive.Applications

    This book will guide you in integrating add-ons that will add value to any Spring Security module. By the end of the book, you will be proficient at integrating Spring Security in your Java ...

    Spring mvc 接收json对象

    本文通过代码实例介绍spring mvc 接收json数据的方法,具体详情如下所示: 接收JSON 使用 @RequestBody 注解前台只需要向 Controller 提交一段符合格式的 JSON,Spring 会自动将其拼装成 bean。 1)在上面的项目中...

    Spring Boot 2 Recipes: A Problem-Solution Approach

    Add persistence and a data tier seamlessly to make your Spring Boot web application do more Integrate enterprise services to create a more complex Java application using Spring Boot Who This Book ...

    Spring3 MVC +HibernateJPA Eclipse Demo

    3、调试环境:eclipse(File-import-existing Eclipse projects选项来导入项目),导入项目后,如果lib库jar文件链接错误,请按照以下步骤重新添加:在项目名“jpaMVC”上右键点击-Bulid Path-Libraries-Add External ...

    Spring3 MVC Hibernate-JPA Eclipse Demo

    3、调试环境:eclipse(File-import-existing Eclipse projects选项来导入项目),导入项目后,如果lib库jar文件链接错误,请按照以下步骤重新添加:在项目名“jpaMVC”上右键点击-Bulid Path-Libraries-Add External ...

    ASP.NET MVC MSDN 文档 CHM

    ASP.NET MVC 1.0 MSDN Reference CHM Version ASP.NET MVC 1.0 MSDN 参考及...How to: Add a Custom MVC Test Framework in Visual Studio ASP.NET MVC Reference -------------------- 有人嫌贵,特将资源分调整为2.

    css-in-js-utils:JS解决方案中CSS的有用实用程序功能

    yarn add css-in-js-utils 为什么? 到现在为止,我已经在许多不同的库上进行创作和协作,发现我每次都会重写完全相同的实用程序函数。 这就是为什么该存储库托管专门为CSS-in-JS解决方案和工具构建的小型实用程序...

    asp.net mvc

    To help reduce conflicts with other Ajax libraries, the built-in ASP.NET MVC validation scripts are now in a separate JavaScript file. ASP.NET MVC validation scripts can be included at the top or ...

    EPM Add-in_NET40

    office 2013 EPM插件,EPM add-in for Microsoft Office 是在由SAP Business...EPM系统插件add-in安装 - EPM 系统插件 Add-in 安装 说明: Add-in 为依附在 excel 上的一个直接访问 EPM 系统 essbase 数据库的小插件。

    Spring.Cookbook.1783985801.epub

    Build full-featured web applications such as Spring MVC applications efficiently that will get you up and running with Spring web development Learn dependency injection and aspect-oriented programming...

    Add-in_Express_v8.1.1432_for_Tokyo_10.2.2.rar

    作为微软Office一体化产业的工具和解决方案的先驱,Add-in Express 10年来一直致力于为成千上万的从Microsoft Office套包中将应用代码集成和嵌入到应用程序中的开发者提供创新的工具和卓越的支持服务。我们在三个...

    Bootstrap.for.ASP.NET.MVC.2nd.Edition.17858894

    Explore JavaScript components by illustrating and walking through the process of using JavaScript/JQuery to add interactivity to Twitter Bootstrap components Build your own ASP.Net MVC helpers and tag...

Global site tag (gtag.js) - Google Analytics