java - JSP can't find stylesheets, images -



java - JSP can't find stylesheets, images -

possible duplicate: jsp can't find stylesheet

tomcat7, spring framework3, jstl 1.2. hierarchy: web-inf/jsp web-inf/styles

i link stylesheet in jsp file, located in web-inf/jsp: doesn't work! when open application there no styles, , writter tomcat:

apache tomcat/7.0.14 - error study http status 404 - type status study message description requested resource () not available. apache tomcat/7.0.14

so set styles folder out of web-inf , still doesn't work! also, images don't work, images folder not in web-inf , path corect... problem?

in spring set resources in folder outside of web-inf. this:

web.xml

<!-- processes application requests --> <servlet> <servlet-name>appservlet</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <init-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/spring/appservlet/servlet-context.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>

then in servlet-context.xml (configuration file specified in web.xml) file exclude resources directory beingness managed dispatcher, urls prefixed resources/ not picked dispatcher , attempted routed appropriate controller.

<!-- handles http requests /resources/** efficiently serving static resources in ${webapproot}/resources directory --> <resources mapping="/resources/**" location="/resources/" />

in jsp can access resources normal:

<link rel="stylesheet" type="text/css" href="/skillsmanager-ui/resources/css/reset.css" />

java jsp tags jstl stylesheet

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -