, Ranch Hand
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.
, Ranch Hand
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.
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
ScroogeXHTML 7.1 - RTF to HTML5 / XHTML converter
This thread has been viewed 5029 times.
All times above are in ranch (not your local) time.
The current ranch time is
Feb 22, 2018 23:39:14.