Spring Mvc Css Js Files
Code: MyProj WEB-INF web views all jsps here javascripts all javascripts here css all css here images all images herethen if my jsps uses javascripts and css then how can i make the jsps access those files even though they are inside WEB-INF.Is there any way i can make it work??You can't. It's just how the WEB-INF folder is ment to behave - protect its resources. Same goes with normal html files, they are not accessible inside WEB-INF directory, unless you use a Controller as a 'handler'.
Here's my (maven) project structure. If my jsps uses javascripts and css then how can i make the jsps access those files even though they are inside WEB-INF.Is there any way i can make it work??No offense meant, but it sounds like you may not really understand how CSS and JavaScript are used within a JSP. Unless you are pulling the contents of the.js and.css files inline into the page content, it's the web browser that is requesting the files from the web server.
When I try to access css/js file both inside and. Including css and js file in spring mvc 3. Your configuration files map resources in webapp. How to exclude css and js files from Spring MVC dispatcher mapping. January 4, 2013 Bruno Reminders, Spring, 2. After setting up basics for the Spring MVC dispatcher.
Your pages aren't directly accessing the files at all. Contrast this with the fact that the web browser is not directly accessing the.jsp file, but instead the Spring dispatcher servlet (which is responsible for reading the file from the file system and rendering it to the browser).
Give More Feedback
Hopefully this clears things up.
See More On Stackoverflow
I am new to Spring mvc. I want to add css and js files in jsp.
Spring Mvc Css
It's a spring mvc framework. This is my spring-dispatcher-servlet.xml code SpringDemo is my project name folder. I keep my file in SpringDemo/WebContent/resources/css and in the same location i keep my js file also SpringDemo/WebContent/resources/js Below code is jsp file called RegistrationForm.jsp.