2017-10-12 5 views
0

私は春のセキュリティとWebアプリケーションを持っています。春のセキュリティ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

私はちょうど私がWebLogicの場合、あなたには、いくつかの追加の設定が必要と考えている。この

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

プロジェクトをfolder.Build WEB-INFでWebLogic配備記述子を追加し、展開します。私の場合、私の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> 
関連する問題