java - How to intercept html js css files using spring interceptor or filter? -
i developed spring mvc + html + angularjs application. put frontend files under /webapp follows. enter image description here
obviously, not want url /admin/admin.html go through dispatcherservlet. therefore, mark html, css, js files resources in applicationcontext follows.
<mvc:annotation-driven/> <context:component-scan base-package="com.lixindi.gradproject"/> <mvc:resources mapping="/login/**" location="/login/"/> <mvc:resources mapping="/admin/**" location="/admin/"/> <mvc:resources mapping="/vote/**" location="/vote/"/>
and used interceptor intercept url /admin/** make sure users logged in.
<mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/admin/**"/> <bean class="com.lixindi.gradproject.interceptor.logininterceptor"/> </mvc:interceptor> </mvc:interceptors>
the problem interceptor intercept url such /admin/123, /admin/123.abc, js, css, html files /admin/admin.html, /admin/css/admin.css. , same when used filter.
how intercept these files?
Comments
Post a Comment