spring-4

    0熱度

    1回答

    我正在使用Spring 4 AOP,並且我創建的方面永遠不會被調用,我無法弄清楚爲什麼會這樣。你看,我有這樣的客戶端類: package com.example.aspects; public class Client { public void talk(){ } } 而且我的方面: 包com.example.aspects; import org.aspec

    4熱度

    5回答

    我有一個非常簡單的Spring Rest backend,它返回JSON數據。 REST風格的URL是工作在我的瀏覽器,像這樣: http://localhost:8080/abc/runlist 它返回像這樣的數據: [{"stock_num":"KOH19","damage":"Toronto (Oshawa)"},{"stock_num":"AZ235","damage":"Toronto

    1熱度

    1回答

    我正在做一個maven項目,我把log4j.xml放在這個路徑中:/src/main/java/log4j.xml,它工作正常,我可以將log4j.xml配置文件移動到/ src/main /資源/ ??什麼是新的配置將是?

    -1熱度

    1回答

    我一直在尋找一種在運行時添加數據源的方法。我想遠離在@Configuration類中定義數據源,而是在應用程序加載時我想動態創建數據源bean並將它們注入到Spring上下文中。我真的不知道我該怎麼做。

    0熱度

    1回答

    我試圖更新從春天2大PROJEKT春4 在豆類層次的深水區失蹤,我發現了一個名爲CustomAbstractStatelessSessionBean類,並從org.springframework.ejb.support.AbstractStatelessSessionBean擴展AbstractStatelessSessionBean類。 類的內容: public abstract class C

    0熱度

    1回答

    此配置無法自動裝配DAO類 配置: <?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:aop=

    1熱度

    1回答

    我想配置春季啓動 - 嵌入式Tomcat基本HTTP身份驗證與多個角色,其中大部分網址的類似,但很少具體到每個角色。這裏的第一個角色是基本的HTTP身份驗證彈出並正常工作。下面的代碼, @Configuration @EnableWebMvcSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) public

    1熱度

    2回答

    我有我的JUnit測試類: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { AppConfig.class }) @WebAppConfiguration public class TelephoneNumberTest { @Autowired //Test that bean exis

    2熱度

    1回答

    我需要爲登臺服務器設置全局基本HTTP身份驗證。沒有什麼花哨。我只想要求用戶名/密碼來訪問任何東西。我也只想使用Java配置。我已經嘗試了很多不同的解決方案,但都沒有工作。我總是能夠訪問服務器上的所有資源。這是我現在在做什麼: @Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurity

    0熱度

    1回答

    如何確保在Web應用程序中的web.xml在任何Spring類型之前加載? 從WebApplicationInitializer的Javadoc: WEB-INF/web.xml和WebApplicationInitializer使用不是相互 排斥;例如,web.xml可以註冊一個servlet,而WebApplicationInitializer可以註冊另一個servlet。一個初始化可以 甚至