I am unable to include a css file in my jsp. My configurations are as follows:-
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="scripts/mystyle.css" rel="stylesheet" type="text/css"/>
ModelAndView mav = new ModelAndView("home");
My jsps are in WEB/-inf/jsp/home.jps and my css file is in WEB-INF/jsp/scripts/mystyle.css. Could anyone please help me in knowing what I am missing?
Thanks in advance.
1) Nothing under WEB-INF can be served. Move any CSS, script and image files out of WEB-INF.
2) Avoid page-relative URLs. User server-relative URLs. See the JSP FAQ.
This is a general JSP issue, so it's been moved to the JSP forum.
thank you for the quick reply. Following your suggestion I was successfully able to include my css file in the jsp page.
Once again thanks for the help.
This thread has been viewed 5270 times.
All times above are in ranch (not your local) time.
The current ranch time is
Dec 13, 2018 11:07:16.