Note that there are some explanatory texts on larger screens.

plurals
  1. POcan't find css, images and js static files in spring
    primarykey
    data
    text
    <p>my servlet-context.xml file</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&gt; &lt;!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure --&gt; &lt;context:component-scan base-package="com.aitrich.learnware.web" /&gt; &lt;!-- Enables the Spring MVC @Controller programming model --&gt; &lt;mvc:annotation-driven /&gt; &lt;!-- Maps '/' requests to the 'home' view --&gt; &lt;mvc:view-controller path="/" view-name="home" /&gt; &lt;!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory --&gt; &lt;mvc:resources mapping="/resources/css/**" location="/resources/css/" /&gt; &lt;mvc:resources mapping="/resources/js/libs/**" location="/resources/js/libs/" /&gt; &lt;mvc:resources mapping="/resources/img/**" location="/resources/img/" /&gt; &lt;!-- Internationalization support --&gt; &lt;bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"&gt; &lt;property name="defaultLocale" value="en_US" /&gt; &lt;/bean&gt; &lt;bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"&gt; &lt;property name="paramName" value="language" /&gt; &lt;/bean&gt; &lt;bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"&gt; &lt;property name="interceptors"&gt; &lt;list&gt; &lt;ref bean="localeChangeInterceptor" /&gt; &lt;/list&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"&gt; &lt;property name="basename" value="locale/messages" /&gt; &lt;/bean&gt; &lt;!-- **************************************************************** --&gt; &lt;!-- THYMELEAF-SPECIFIC ARTIFACTS --&gt; &lt;!-- TemplateResolver &lt;- TemplateEngine &lt;- ViewResolver --&gt; &lt;!-- **************************************************************** --&gt; &lt;bean id="templateResolver" class="org.thymeleaf.templateresolver.ServletContextTemplateResolver"&gt; &lt;property name="prefix" value="/WEB-INF/views/" /&gt; &lt;property name="suffix" value=".html" /&gt; &lt;property name="templateMode" value="HTML5" /&gt; &lt;/bean&gt; &lt;bean id="templateEngine" class="org.thymeleaf.spring3.SpringTemplateEngine"&gt; &lt;property name="templateResolver" ref="templateResolver" /&gt; &lt;!-- These lines configure the dialects to use with Thymeleaf --&gt; &lt;property name="dialects"&gt; &lt;set&gt; &lt;bean class="org.thymeleaf.spring3.dialect.SpringStandardDialect" /&gt; &lt;bean class="nz.net.ultraq.web.thymeleaf.LayoutDialect" /&gt; &lt;/set&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean class="org.thymeleaf.spring3.view.ThymeleafViewResolver"&gt; &lt;property name="templateEngine" ref="templateEngine" /&gt; &lt;/bean&gt; &lt;/beans&gt; </code></pre> <p>And i access the image using thymeleaf like</p> <pre><code>&lt;img src="../../resources/img/cancel.png" th:attr="src=@{resources/img/cancel.png}, title=#{background}, alt=#{background}" /&gt; </code></pre> <p>But nothing is showing..!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload