Tôi đang sử dụng Spring MVC cho dự án AngularJS.Spring MVC chuyển hướng đến jsp cho url cụ thể
Tôi đang phân phối JSON từ url được đặt trước bằng "/ rest/*". Tất cả các tập tin jsp được truy cập trực tiếp và định tuyến được xử lý bằng cách sử dụng angular-js.
Tôi cần phải thực hiện xác thực tùy chỉnh trước khi tệp jsp được truy cập. Đối với các url còn lại (url được đặt trước bằng "/ rest/*"), tôi đã có bộ lọc tại chỗ.
Làm cách nào tôi có thể định cấu hình bộ điều phối-servlet sao cho tất cả các tệp jsp đều được truy cập khi xác thực được thực hiện bởi bộ điều khiển lò xo.
web.xml
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
phối-servlet.xml
<?xml version='1.0' encoding='UTF-8' ?>
<!-- was: <?xml version="1.0" encoding="UTF-8"?> -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.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">
<context:component-scan base-package="com.gauti" />
<mvc:annotation-driven />
</beans>