我有Spring安全性的web應用程序。Spring Security weblogic js loading
當我在tomcat9
上運行我的應用程序時,所有工作都正常,但是當我使用oracle Weblogic時,出現了一些問題,並且我的應用程序中的js腳本不起作用。
拒絕執行'http://localhost:7001/ais/s/lib/datetime/js/moment-with-locales.min.js'中的腳本,因爲它的MIME類型('application/octet-stream
')不可執行,並且啓用嚴格的MIME類型檢查。
這是我的安全配置:
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
UserService service;
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/s/**").permitAll()
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login")
.permitAll()
.and()
.logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.permitAll();
}
@Override
protected void configure(AuthenticationManagerBuilder auth)
throws Exception {
auth
.userDetailsService(new UserDetailServiceImpl(service));
}
}
相信對於weblogic的,你需要一些額外的配置解決它。您的項目中是否有任何「WEB-INF」文件夾? –
@AururRahmanMunna是的,我有我的/ s /文件夾與js css,/ views/ – Coder
和xml:dispatcher-servlet,web,weblogic,jdbc,tiles – Coder