2017-10-12 20 views
0

스프링 보안이 적용된 웹 응용 프로그램이 있습니다.스프링 보안 weblogic js로드

tomcat9에서 앱을 실행할 때 oracle Weblogic을 사용할 때 문제가 발생하고 앱의 js 스크립트가 작동하지 않습니다.

해당 MIME 유형 ('application/octet-stream')이 실행 가능하지 않으며 엄격한 MIME 유형 검사가 사용 가능하므로 'http://localhost:7001/ais/s/lib/datetime/js/moment-with-locales.min.js'에서 스크립트 실행을 거부했습니다.

이 내 보안 설정입니다 :

@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)); 
    } 
} 
+0

, 당신은 몇 가지 추가 구성이 필요의 SecurityConfig에 넣어 그것을 해결. 프로젝트에'WEB-INF' 폴더가 있습니까? –

+0

@AtaurRahmanMunna 예, js css,/views/ – Coder

+0

및 xml : dispatcher-servlet, web, weblogic, jdbc, tiles가있는/s/폴더가 있습니다. – Coder

답변

0

난 그냥 웹 로직에 대한 생각이

@Override 
public void configure(WebSecurity web) throws Exception { 
    web.ignoring().antMatchers("/s/**"); 
} 
0

프로젝트를 folder.Build WEB-INF에 웹 로직 배치 기술자를 추가하고 배포 할 수 있습니다. 내 경우에는 내 XML 모양처럼. weblogic.xml

<?xml version="1.0" encoding="UTF-8"?> 
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd"> 
    <jsp-descriptor> 
    <keepgenerated>true</keepgenerated> 
    <debug>true</debug> 
    </jsp-descriptor> 
    <container-descriptor> 
    <prefer-web-inf-classes>true</prefer-web-inf-classes> 
    </container-descriptor> 
    <context-root>/ContextRootOfYourApp</context-root> 
</weblogic-web-app>